Update API Promise combineLatest signature (#528)

This commit is contained in:
Jaco Greeff
2019-01-03 17:48:20 +01:00
committed by GitHub
parent d282b4a5d7
commit 4f55d19238
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -244,7 +244,7 @@ export default class ApiPromise extends ApiBase<DecoratedRpc, QueryableStorage,
* });
* ```
*/
combineLatest (fns: Array<CombinatorFunction>, callback: CombinatorCallback): UnsubFunction {
combineLatest (fns: Array<CombinatorFunction | [Array<any>, CombinatorFunction]>, callback: CombinatorCallback): UnsubFunction {
const combinator = new Combinator(fns, callback);
return (): void => {
+6 -1
View File
@@ -25,6 +25,11 @@ export interface DecoratedRpc {
system: DecoratedRpc$Section;
}
export interface QueryableStorageFunction$Subscribe {
(arg: any, cb: (value?: any | null) => any): UnsubFunction;
(cb: (value?: any | null) => any): UnsubFunction;
}
export interface QueryableStorageFunction extends StorageFunction {
(cb: (value?: any | null) => any): UnsubFunction;
(arg: any, cb: (value?: any | null) => any): UnsubFunction;
@@ -32,7 +37,7 @@ export interface QueryableStorageFunction extends StorageFunction {
at: (hash: Hash, arg?: any) => Promise<Codec | null | undefined>;
// This one is slightly more sane with regards to type-checking, requiring less boilerplate to
// coax the intent of the the actual function with a split between subs and calls
subscribe: ((arg: any, cb: (value?: any | null) => any) => UnsubFunction) | ((cb: (value?: any | null) => any) => UnsubFunction);
subscribe: QueryableStorageFunction$Subscribe;
}
export interface QueryableModuleStorage {