fix cross-package reference in d.ts (#763)

* fix cross-package reference in d.ts

* fix check
This commit is contained in:
Ian He
2019-03-08 10:26:43 +01:00
committed by Amaury Martiny
parent 5fbca9ae97
commit c87502d254
2 changed files with 7 additions and 4 deletions
+4 -3
View File
@@ -3,8 +3,9 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import memoizee from 'memoizee';
import { ApiInterface$Rx } from '@polkadot/api/types';
import { ApiInterface$Decorated } from '@polkadot/api/types';
import { Codec } from '@polkadot/types/types';
import { Observable } from 'rxjs';
/**
* Create memoization for a 2-currified function.
*
@@ -20,7 +21,7 @@ import { ApiInterface$Rx } from '@polkadot/api/types';
* f(api)(1, 2); // Cache hit
* ```
*/
export const cache = (fn: Function, map = new WeakMap()) => (api: ApiInterface$Rx) => {
export const cache = (fn: Function, map = new WeakMap()) => (api: ApiInterface$Decorated<Observable<Codec>, Observable<Codec>>) => {
if (!map.has(api)) {
const innerFn = fn(api);
map.set(api, memoizee(innerFn));