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

doesn't support payloads with dates #32

Open
makerGeek opened this issue Dec 12, 2020 · 1 comment
Open

doesn't support payloads with dates #32

makerGeek opened this issue Dec 12, 2020 · 1 comment

Comments

@makerGeek
Copy link

Tested using localStorage strategy.

When committing a mutation with a payload that contains a date object, the date is converted to a string in the receiving end.

This is probably due to the serialization of payload that's done before storing the payload in localStorage.

@Glandos
Copy link

Glandos commented May 10, 2021

I faced the same issue, but the solution isn't so obvious.

  • Vuex says nothing about Date, except that it handles only plain objects
  • Vue-DevTools supports dates with a special logic
  • This project use a standard JSON serialization + store commits, so it'll need some special case to handle Dates

Since I'm using date-fns, I'm currently thinking of using number, and everything will be much simpler. Except for debugging.

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