Bump dependencies

This commit is contained in:
Jaco Greeff
2018-05-15 14:26:05 +02:00
parent 989e8284ca
commit 91862244a4
9 changed files with 561 additions and 1226 deletions
+6 -3
View File
@@ -10,7 +10,8 @@ type Cached$ParamJson = string;
type CachedMap = {
[Cached$Name]: {
[Cached$ParamJson]: rxjs$BehaviorSubject<*>
// flowlint-next-line unclear-type:off
[Cached$ParamJson]: rxjs$BehaviorSubject<any>
}
};
@@ -18,12 +19,14 @@ const subject = require('./subject');
const cacheMap: CachedMap = {};
module.exports = function cached (subName: string, name: string, section: ApiInterface$Section): (...params: Array<mixed>) => rxjs$BehaviorSubject<*> {
// flowlint-next-line unclear-type:off
module.exports = function cached (subName: string, name: string, section: ApiInterface$Section): (...params: Array<mixed>) => rxjs$BehaviorSubject<any> {
if (!cacheMap[subName]) {
cacheMap[subName] = {};
}
return (...params: Array<mixed>): rxjs$BehaviorSubject<*> => {
// flowlint-next-line unclear-type:off
return (...params: Array<mixed>): rxjs$BehaviorSubject<any> => {
const paramStr = JSON.stringify(params);
if (!cacheMap[subName][paramStr]) {
+4 -2
View File
@@ -10,12 +10,14 @@ const isFunction = require('@polkadot/util/is/function');
const cached = require('./cached');
module.exports = function observable (subName: string, name: string, section: ApiInterface$Section): (...params: Array<mixed>) => rxjs$Observable<*> | rxjs$BehaviorSubject<*> {
// flowlint-next-line unclear-type:off
module.exports = function observable (subName: string, name: string, section: ApiInterface$Section): (...params: Array<mixed>) => rxjs$Observable<any> | rxjs$BehaviorSubject<any> {
if (isFunction(section[name].unsubscribe)) {
return cached(subName, name, section);
}
return (...params: Array<mixed>): rxjs$Observable<*> =>
// flowlint-next-line unclear-type:off
return (...params: Array<mixed>): rxjs$Observable<any> =>
fromPromise(
section[name].apply(null, params)
);
+2 -1
View File
@@ -5,7 +5,8 @@
import type { InterfaceTypes } from '@polkadot/api-jsonrpc/types';
export type RxApiInterface$Method = (...params: Array<mixed>) => rxjs$Observable<*> | rxjs$BehaviorSubject<*>;
// flowlint-next-line unclear-type:off
export type RxApiInterface$Method = (...params: Array<mixed>) => rxjs$Observable<any> | rxjs$BehaviorSubject<any>;
export type RxApiInterface$Section = {
[string]: RxApiInterface$Method