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

add support of undefined type in initialState #17

Closed
lhr000lhr opened this issue Jun 8, 2022 · 4 comments
Closed

add support of undefined type in initialState #17

lhr000lhr opened this issue Jun 8, 2022 · 4 comments

Comments

@lhr000lhr
Copy link

previous version support put undefined in initialState,
after upgrading to the latest version, Foca shows the error

image

@geekact
Copy link
Member

geekact commented Jun 8, 2022

undefined is unsafe when using persistence feature.

const data  = { x: undefined, y: 1 };
const data1 = JSON.parse(JSON.stringify(data)); // { y: 1 }

Maybe I should only limit the models which want to use persistence instead of all models.

@geekact
Copy link
Member

geekact commented Jun 8, 2022

What's the case you have to input undefined key ? We know that value will always be undefined when you are visiting a non-exists key. My suggestion is do not explicit set a key whose value is undefined

@geekact
Copy link
Member

geekact commented Jun 8, 2022

Anyway, I have published version 0.12.2 to fix this issue. Good luck.

@geekact geekact closed this as completed Jun 8, 2022
@lhr000lhr
Copy link
Author

thanks, man.

This issue was closed.
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

2 participants