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

Commit a017641

Browse files
authored
Rename InitialStateToken to GetInitialStateToken (#69)
#69
1 parent 0d3753b commit a017641

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ yarn add fusion-plugin-react-redux
2121
```js
2222
// in your main.js file
2323
import React from 'react';
24-
import Redux, {ReduxToken, ReducerToken, EnhancerToken, InitialStateToken} from 'fusion-plugin-react-redux';
24+
import Redux, {ReduxToken, ReducerToken, EnhancerToken, GetInitialStateToken} from 'fusion-plugin-react-redux';
2525
import ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';
2626
import App from 'fusion-react';
2727
import reducer from './reducer';
@@ -31,7 +31,7 @@ export default function start() {
3131
app.register(ReduxToken, Redux);
3232
app.register(ReducerToken, reducer);
3333
app.register(EnhancerToken, ReduxActionEmitterEnhancer);
34-
__NODE__ && app.register(InitialStateToken, async (ctx) => {
34+
__NODE__ && app.register(GetInitialStateToken, async (ctx) => {
3535
return {};
3636
});
3737

@@ -55,13 +55,13 @@ import {
5555
ReducerToken,
5656
PreloadedStateToken,
5757
EnhancerToken,
58-
InitialStateToken
58+
GetInitialStateToken
5959
} from 'fusion-plugin-react-redux';
6060

6161
app.register(ReducerToken, reducer);
6262
app.register(PreloadedStateToken, preloadedState);
6363
app.register(EnhancerToken, enhancer);
64-
__NODE__ && app.register(InitialStateToken, getInitialState);
64+
__NODE__ && app.register(GetInitialStateToken, getInitialState);
6565
```
6666

6767
Creates the redux store and integrates it into the FusionJS application.
@@ -78,7 +78,7 @@ Name | Type | Default | Description
7878
-|-|-|-
7979
`PreloadedStateToken` | `any` | `undefined` | Overrides the initial state in the server, and the hydrated state in the client
8080
`EnhancerToken` | `FusionPlugin` | `undefined` | Enhances the store with 3rd party capabilities, such as middlewares, time travel, persistence, etc. We are currently investigating enhancer composition in fusionjs/fusion-core#90, but for now you can use plugin aliasing for registering multiple enhancers: `app.register(EnhancerToken, ReduxActionEmitterEnhancer).alias(EnhancerToken, AnotherEnhancerPlugin);`.
81-
`InitialStateToken` | `(ctx) => Promise<any>` | `undefined` | A function that returns the initial state for your redux store. Server-side only.
81+
`GetInitialStateToken` | `(ctx) => Promise<any>` | `undefined` | A function that returns the initial state for your redux store. Server-side only.
8282

8383
#### Factory
8484

docs/migrations/00069.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#### Rename `InitialStateToken` to `GetInitialStateToken`
2+
3+
```diff
4+
-import {InitialStateToken} from 'fusion-plugin-react-redux';
5+
+import {GetInitialStateToken} from 'fusion-plugin-react-redux';
6+
```

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ export {
1414
ReducerToken,
1515
PreloadedStateToken,
1616
EnhancerToken,
17-
InitialStateToken,
17+
GetInitialStateToken,
1818
} from './tokens';

src/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
ReducerToken,
1414
PreloadedStateToken,
1515
EnhancerToken,
16-
InitialStateToken,
16+
GetInitialStateToken,
1717
} from './tokens.js';
1818

1919
export default __NODE__ &&
@@ -22,7 +22,7 @@ export default __NODE__ &&
2222
reducer: ReducerToken,
2323
preloadedState: PreloadedStateToken.optional,
2424
enhancer: EnhancerToken.optional,
25-
getInitialState: InitialStateToken.optional,
25+
getInitialState: GetInitialStateToken.optional,
2626
},
2727
provides({reducer, preloadedState, enhancer, getInitialState}) {
2828
class Redux {

src/tokens.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export const ReduxToken = createToken('ReduxToken');
1010
export const ReducerToken = createToken('ReducerToken');
1111
export const PreloadedStateToken = createToken('PreloadedStateToken');
1212
export const EnhancerToken = createToken('EnhancerToken');
13-
export const InitialStateToken = createToken('InitialStateToken');
13+
export const GetInitialStateToken = createToken('GetInitialStateToken');

0 commit comments

Comments
 (0)