Expose unsubscribe on promise storage (#518)

This commit is contained in:
Jaco Greeff
2018-12-28 14:18:26 +01:00
committed by GitHub
parent e0300d61af
commit 907c2f59cf
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -255,6 +255,8 @@ export default class ApiPromise extends ApiBase<Rpc, QueryableStorage, Submittab
decorated.at = (hash: Hash, arg?: any): Promise<Codec | null | undefined> =>
this.rpc.state.getStorage([method, arg], hash);
decorated.unsubscribe = (subscriptionId: any): Promise<any> =>
this.rpc.state.subscribeStorage.unsubscribe(subscriptionId);
return this.decorateFunctionMeta(method, decorated) as QueryableStorageFunction;
}
+1
View File
@@ -15,6 +15,7 @@ import SubmittableExtrinsic from './SubmittableExtrinsic';
export interface QueryableStorageFunction extends StorageFunction {
(arg?: any): Promise<Codec | null | undefined>;
at: (hash: Hash, arg?: any) => Promise<Codec | null | undefined>;
unsubscribe: (subscriptionId: any) => Promise<any>;
}
export interface QueryableModuleStorage {