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

state value may be undefined on purpose #35

Closed
nandin-borjigin opened this issue Oct 11, 2018 · 3 comments
Closed

state value may be undefined on purpose #35

nandin-borjigin opened this issue Oct 11, 2018 · 3 comments

Comments

@nandin-borjigin
Copy link

if (['undefined', 'function'].indexOf(typeof (module.state as S)[key]) === -1) {

Since state values might be initialized to undefined on purpose, excluding undefined here would be problmatic.

@nandin-borjigin nandin-borjigin changed the title state value may be undefined on purpos state value may be undefined on purpose Oct 11, 2018
@championswimmer
Copy link
Owner

State values should never be initialized undefined on purpose. It makes them loose reactivity. Initialize them as null if you want to.

@FlorianWendelborn
Copy link
Contributor

@championswimmer @Nandiin Since this is effectively a wontfix, can we close it?

@ac51300696
Copy link

So, what kind of cases can prove the problem here, because processing null will have extra burden of judgment, and sometimes the difference between null and undefined cannot be erased @championswimmer

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

No branches or pull requests

4 participants