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

Rule: prefer-serializable-value-in-store #91

Open
igorkamyshev opened this issue Feb 15, 2022 · 1 comment
Open

Rule: prefer-serializable-value-in-store #91

igorkamyshev opened this issue Feb 15, 2022 · 1 comment
Labels
good first issue Good for newcomers

Comments

@igorkamyshev
Copy link
Member

This code

const $data = createStore(new Date())
const setData = createEvent<Date>()

const scope1 = fork()

await allSettled(setData, { scope: scope1, params: new Date('2020-01-01') })

const json = JSON.stringify(serialize(scope))

const scope2 = fork()

hydrate(scope2, { values: JSON.parse(json) })

will produce error because Date will be serialized to ISO-format, but won't be deserialized back.

We can warn user about it

@igorkamyshev igorkamyshev added the good first issue Good for newcomers label Feb 15, 2022
@igorkamyshev
Copy link
Member Author

cc @alatielle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant