-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow initial state function for AoT compatibility #59
Conversation
docs/store/api.md
Outdated
/// Pretend this is dynamically injected at runtime | ||
const initialStateFromSomewhere = { counter: 3 }; | ||
|
||
/// Static static |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Static state
i guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed thanks
9da06fd
to
2087926
Compare
FYI, tests are all passing, but coveralls is throwing a fit. |
docs/store/api.md
Outdated
const initialState = { counter: 2 }; | ||
|
||
/// In this function dynamic state slices, if they exist, will overwrite static state at runtime. | ||
const getInitialState = () => ({...initialState, ...initialStateFromSomewhere}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be exported and a plain function instead of a arrow function for AOT support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
2087926
to
f5ac836
Compare
Thanks! |
resolves #51