Skip to content
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

Define empty state if initialState function not called #4

Merged
merged 1 commit into from
Jul 20, 2015

Conversation

ahume
Copy link
Collaborator

@ahume ahume commented Jul 20, 2015

this.state, by definiton, is an object of key/values. It should
never be undefined. If no state has been set yet, this.state should
be an empty object.

NB: This is useful, because in with-observable-state we kinda need an initial state, otherwise we're pushing undefined values down the stream, and subscribers have to handle these individually. Another option is to make initialState a required call.

this.state, by definiton, is an object of key/values. It should
never be undefined. If no state has been set yet, this.state should
be an empty object.
tgvashworth added a commit that referenced this pull request Jul 20, 2015
Define empty state if initialState function not called
@tgvashworth tgvashworth merged commit 0846862 into master Jul 20, 2015
@tgvashworth tgvashworth deleted the default-state branch July 20, 2015 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants