diff options
Diffstat (limited to 'src/features/utils')
-rw-r--r-- | src/features/utils/ActionBinding.ts | 5 | ||||
-rw-r--r-- | src/features/utils/FeatureStore.test.js | 21 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/features/utils/ActionBinding.ts b/src/features/utils/ActionBinding.ts index 787166d44..16308fae4 100644 --- a/src/features/utils/ActionBinding.ts +++ b/src/features/utils/ActionBinding.ts | |||
@@ -24,6 +24,5 @@ export default class ActionBinding { | |||
24 | } | 24 | } |
25 | } | 25 | } |
26 | 26 | ||
27 | export const createActionBindings = (actions) => ( | 27 | export const createActionBindings = actions => |
28 | actions.map((a) => new ActionBinding(a)) | 28 | actions.map(a => new ActionBinding(a)); |
29 | ); | ||
diff --git a/src/features/utils/FeatureStore.test.js b/src/features/utils/FeatureStore.test.js index 92308bf52..1995431bd 100644 --- a/src/features/utils/FeatureStore.test.js +++ b/src/features/utils/FeatureStore.test.js | |||
@@ -5,9 +5,12 @@ import { createActionsFromDefinitions } from '../../actions/lib/actions'; | |||
5 | import { createActionBindings } from './ActionBinding'; | 5 | import { createActionBindings } from './ActionBinding'; |
6 | import { createReactions } from '../../stores/lib/Reaction'; | 6 | import { createReactions } from '../../stores/lib/Reaction'; |
7 | 7 | ||
8 | const actions = createActionsFromDefinitions({ | 8 | const actions = createActionsFromDefinitions( |
9 | countUp: {}, | 9 | { |
10 | }, PropTypes.checkPropTypes); | 10 | countUp: {}, |
11 | }, | ||
12 | PropTypes.checkPropTypes, | ||
13 | ); | ||
11 | 14 | ||
12 | class TestFeatureStore extends FeatureStore { | 15 | class TestFeatureStore extends FeatureStore { |
13 | @observable count = 0; | 16 | @observable count = 0; |
@@ -15,12 +18,10 @@ class TestFeatureStore extends FeatureStore { | |||
15 | reactionInvokedCount = 0; | 18 | reactionInvokedCount = 0; |
16 | 19 | ||
17 | start() { | 20 | start() { |
18 | this._registerActions(createActionBindings([ | 21 | this._registerActions( |
19 | [actions.countUp, this._countUp], | 22 | createActionBindings([[actions.countUp, this._countUp]]), |
20 | ])); | 23 | ); |
21 | this._registerReactions(createReactions([ | 24 | this._registerReactions(createReactions([this._countReaction])); |
22 | this._countReaction, | ||
23 | ])); | ||
24 | } | 25 | } |
25 | 26 | ||
26 | _countUp = () => { | 27 | _countUp = () => { |
@@ -29,7 +30,7 @@ class TestFeatureStore extends FeatureStore { | |||
29 | 30 | ||
30 | _countReaction = () => { | 31 | _countReaction = () => { |
31 | this.reactionInvokedCount += 1; | 32 | this.reactionInvokedCount += 1; |
32 | } | 33 | }; |
33 | } | 34 | } |
34 | 35 | ||
35 | describe('FeatureStore', () => { | 36 | describe('FeatureStore', () => { |