* RxJS 6

* Don't log observable promise.catch to console

* Extra space
This commit is contained in:
Jaco Greeff
2018-08-07 17:30:18 +02:00
committed by GitHub
parent a0336893a4
commit e2365bb00a
12 changed files with 25 additions and 34 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-format",
"version": "0.14.31",
"version": "0.15.0",
"description": "Input/Output formatters for JsonRPC exchange",
"main": "index.js",
"keywords": [
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-provider",
"version": "0.14.31",
"version": "0.15.0",
"description": "Transport providers for the API",
"main": "index.js",
"keywords": [
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-rx",
"version": "0.14.31",
"version": "0.15.0",
"description": "An RxJs wrapper around the Polkadot JS API",
"main": "index.js",
"keywords": [
@@ -35,9 +35,9 @@
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.51",
"@polkadot/api": "^0.14.31",
"@polkadot/api-provider": "^0.14.31",
"@polkadot/api": "^0.15.0",
"@polkadot/api-provider": "^0.15.0",
"@types/rx": "^4.1.1",
"rxjs": "^5.5.10"
"rxjs": "^6.2.2"
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
import { ProviderInterface } from '@polkadot/api-provider/types';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject } from 'rxjs';
export default function connected (provider: ProviderInterface): BehaviorSubject<boolean> {
const subject = new BehaviorSubject(provider.isConnected());
+1 -1
View File
@@ -5,7 +5,7 @@
import { ProviderInterface } from '@polkadot/api-provider/types';
import { RxApiInterface } from '../types';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject } from 'rxjs';
import createConnected from './connected';
+1 -1
View File
@@ -4,7 +4,7 @@
import { ApiInterface$Section } from '@polkadot/api/types';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject } from 'rxjs';
type CachedMap = {
[index: string]: {
+5 -7
View File
@@ -4,9 +4,7 @@
import { ApiInterface$Section } from '@polkadot/api/types';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { fromPromise } from 'rxjs/observable/fromPromise';
import { BehaviorSubject, Observable, from } from 'rxjs';
import isFunction from '@polkadot/util/is/function';
import cached from './cached';
@@ -17,9 +15,9 @@ export default function observable (subName: string, name: string, section: ApiI
}
return (...params: Array<any>): Observable<any> =>
fromPromise(
section[name].apply(null, params).catch((error: Error) =>
console.error(error)
)
from(
section[name].apply(null, params).catch(() => {
// swallow error - mostly storage failures, undefined as result
})
);
}
+1 -3
View File
@@ -4,9 +4,7 @@
import { ApiInterface$Section } from '@polkadot/api/types';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { Subscriber } from 'rxjs/Subscriber';
import { BehaviorSubject, Observable, Subscriber } from 'rxjs';
export default function subscription (name: string, params: Array<any>, section: ApiInterface$Section, unsubCallback?: () => void): BehaviorSubject<any> {
const subject = new BehaviorSubject(undefined);
+1 -2
View File
@@ -3,8 +3,7 @@
// of the ISC license. See the LICENSE file for details.
import { Interfaces } from '@polkadot/jsonrpc/types';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject, Observable } from 'rxjs';
import { Interface$Sections } from '@polkadot/jsonrpc/types';
export type RxApiInterface$Method = (...params: Array<any>) => Observable<any> | BehaviorSubject<any>;
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api",
"version": "0.14.31",
"version": "0.15.0",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
"keywords": [
@@ -35,8 +35,8 @@
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.51",
"@polkadot/api-format": "^0.14.31",
"@polkadot/api-provider": "^0.14.31",
"@polkadot/api-format": "^0.15.0",
"@polkadot/api-provider": "^0.15.0",
"@polkadot/jsonrpc": "^0.27.9",
"@polkadot/params": "^0.27.9",
"@polkadot/util": "^0.27.9"