Skip to content
This repository was archived by the owner on May 17, 2019. It is now read-only.

Commit 32c552b

Browse files
authored
fix types (#151)
1 parent bb8aa12 commit 32c552b

File tree

4 files changed

+1187
-414
lines changed

4 files changed

+1187
-414
lines changed

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,41 @@
2323
"./dist/browser.es2015.es.js": "./dist/browser.es2017.es.js"
2424
},
2525
"dependencies": {
26-
"fusion-plugin-rpc": "^2.1.3",
26+
"fusion-plugin-rpc": "^2.3.0-0",
2727
"fusion-rpc-redux": "^1.2.0",
2828
"prop-types": "^15.6.1"
2929
},
3030
"peerDependencies": {
3131
"fusion-core": "^1.2.6",
32-
"fusion-react": "^1.1.0",
32+
"fusion-react": "^1.3.4-0",
3333
"react": "14.x - 16.x"
3434
},
3535
"devDependencies": {
3636
"babel-eslint": "^10.0.1",
3737
"babel-plugin-transform-flow-strip-types": "^6.22.0",
3838
"create-universal-package": "^3.4.6",
39-
"eslint": "^5.6.1",
39+
"eslint": "^5.9.0",
4040
"eslint-config-fusion": "^4.0.0",
4141
"eslint-plugin-cup": "^2.0.0",
42-
"eslint-plugin-flowtype": "^2.50.3",
42+
"eslint-plugin-flowtype": "^3.2.0",
4343
"eslint-plugin-import": "^2.14.0",
44-
"eslint-plugin-jest": "^21.24.1",
44+
"eslint-plugin-jest": "^22.0.0",
4545
"eslint-plugin-prettier": "^3.0.0",
4646
"eslint-plugin-react": "^7.11.1",
47-
"flow-bin": "^0.83.0",
48-
"fusion-core": "^1.7.0",
49-
"fusion-plugin-universal-events": "^1.2.0",
50-
"fusion-react": "^1.3.0",
51-
"fusion-test-utils": "^1.2.3",
52-
"fusion-tokens": "^1.1.0",
53-
"nyc": "^13.0.1",
54-
"prettier": "1.14.3",
47+
"flow-bin": "^0.86.0",
48+
"fusion-core": "^1.10.0",
49+
"fusion-plugin-universal-events": "^1.3.0",
50+
"fusion-react": "^1.3.4-0",
51+
"fusion-test-utils": "^1.2.4",
52+
"fusion-tokens": "^1.1.1",
53+
"nyc": "^13.1.0",
54+
"prettier": "1.15.2",
5555
"prop-types": "^15.6.1",
56-
"react": "^16.5.2",
57-
"react-dom": "16.6.0",
58-
"react-redux": "^5.0.7",
59-
"react-test-renderer": "^16.5.2",
60-
"redux": "4.0.0",
56+
"react": "^16.6.3",
57+
"react-dom": "16.6.3",
58+
"react-redux": "^5.1.1",
59+
"react-test-renderer": "^16.6.3",
60+
"redux": "4.0.1",
6161
"redux-reactors": "^1.0.3",
6262
"tape-cup": "^4.7.1",
6363
"unitest": "^2.1.1"

src/__tests__/index.browser.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ test('browser plugin integration test withRPCRedux', async t => {
8686
const withTest = compose(
8787
withRPCRedux('test'),
8888
connect(s => s),
89-
prepared(
90-
props => (props.a ? Promise.resolve() : props.test({hello: 'world'}))
89+
prepared(props =>
90+
props.a ? Promise.resolve() : props.test({hello: 'world'})
9191
)
9292
)(Component);
9393

@@ -159,9 +159,8 @@ test('browser plugin integration test withRPCRedux - failure', async t => {
159159
const withTest = compose(
160160
withRPCRedux('test'),
161161
connect(s => s),
162-
prepared(
163-
props =>
164-
props.message ? Promise.resolve() : props.test({hello: 'world'})
162+
prepared(props =>
163+
props.message ? Promise.resolve() : props.test({hello: 'world'})
165164
)
166165
)(Component);
167166

@@ -216,8 +215,8 @@ test('browser mock integration test withRPCRedux', async t => {
216215
const withTest = compose(
217216
withRPCRedux('test'),
218217
connect(s => s),
219-
prepared(
220-
props => (props.a ? Promise.resolve() : props.test({hello: 'world'}))
218+
prepared(props =>
219+
props.a ? Promise.resolve() : props.test({hello: 'world'})
221220
)
222221
)(Component);
223222

@@ -280,9 +279,8 @@ test('browser mock integration test withRPCRedux - failure', async t => {
280279
const withTest = compose(
281280
withRPCRedux('test'),
282281
connect(s => s),
283-
prepared(
284-
props =>
285-
props.message ? Promise.resolve() : props.test({hello: 'world'})
282+
prepared(props =>
283+
props.message ? Promise.resolve() : props.test({hello: 'world'})
286284
)
287285
)(Component);
288286

@@ -374,8 +372,8 @@ test('browser plugin integration test withRPCReactor', async t => {
374372
return {};
375373
},
376374
}),
377-
prepared(
378-
props => (props.a ? Promise.resolve() : props.test({hello: 'world'}))
375+
prepared(props =>
376+
props.a ? Promise.resolve() : props.test({hello: 'world'})
379377
),
380378
connect(s => s)
381379
);
@@ -460,8 +458,8 @@ test('browser mock plugin integration test withRPCReactor', async t => {
460458
return {};
461459
},
462460
}),
463-
prepared(
464-
props => (props.a ? Promise.resolve() : props.test({hello: 'world'}))
461+
prepared(props =>
462+
props.a ? Promise.resolve() : props.test({hello: 'world'})
465463
),
466464
connect(s => s)
467465
);
@@ -557,9 +555,8 @@ test('browser plugin integration test withRPCReactor - failure', async t => {
557555
};
558556
},
559557
}),
560-
prepared(
561-
props =>
562-
props.message ? Promise.resolve() : props.test({hello: 'world'})
558+
prepared(props =>
559+
props.message ? Promise.resolve() : props.test({hello: 'world'})
563560
),
564561
connect(s => s)
565562
);
@@ -669,9 +666,8 @@ test('browser plugin integration test withRPCReactor - failure 2', async t => {
669666
};
670667
},
671668
}),
672-
prepared(
673-
props =>
674-
props.message ? Promise.resolve() : props.test({hello: 'world'})
669+
prepared(props =>
670+
props.message ? Promise.resolve() : props.test({hello: 'world'})
675671
),
676672
connect(s => s)
677673
);

src/plugin.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import PropTypes from 'prop-types';
1111

1212
import {ProviderPlugin} from 'fusion-react';
1313
import rpc, {mock as RPCMock} from 'fusion-plugin-rpc';
14+
import type {RPCType, RPCDepsType} from 'fusion-plugin-rpc';
1415

1516
class RPCProvider extends React.Component<*> {
1617
rpc: typeof rpc;
@@ -31,5 +32,13 @@ RPCProvider.childContextTypes = {
3132
rpc: PropTypes.object.isRequired,
3233
};
3334

34-
export default ProviderPlugin.create('rpc', rpc, RPCProvider);
35-
export const mock = ProviderPlugin.create('rpc', RPCMock, RPCProvider);
35+
export default ProviderPlugin.create<RPCDepsType, RPCType>(
36+
'rpc',
37+
rpc,
38+
RPCProvider
39+
);
40+
export const mock = ProviderPlugin.create<RPCDepsType, RPCType>(
41+
'rpc',
42+
RPCMock,
43+
RPCProvider
44+
);

0 commit comments

Comments
 (0)