Expose unsubscribe on promise storage (#518)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user