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

move ._handler off state #637

Merged
merged 1 commit into from
Mar 14, 2018
Merged

move ._handler off state #637

merged 1 commit into from
Mar 14, 2018

Conversation

yoshuawuyts
Copy link
Member

State should be serializable; by moving ._handler off state we keep state a bit cleaner. Thanks!

@tornqvist
Copy link
Member

Looks good! 👍

Copy link
Collaborator

@bcomnes bcomnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't even know it was there.

@goto-bus-stop
Copy link
Member

this makes sense to me but I wonder what @marcbachmann thinks because there might've been a reason for doing it this way in #613

@marcbachmann
Copy link
Contributor

So far the state variable was the only one which was route-specific and mutable, which was the reason I put it there. I'm good with that change. Tests for that would be good as we'll probably run into the same issue again.

@yoshuawuyts
Copy link
Member Author

@marcbachmann just to have some context: what issue were you running into? Agree we should have some tests for this; want to make sure we test for the right things.

@marcbachmann
Copy link
Contributor

what issue were you running into?

I was referencing to the statement in your issue description. (State should be serializable).
I had no idea that we wanted to have that state object serializable. How do people use it and do we depend on that?

@tornqvist
Copy link
Member

How do people use it and do we depend on that?

I've been experimenting with persisting state to a service worker (for offline support and shared state between tabs) but if you try to post a message with anything but plain serializable values it'll throw.

But yeah, we should probably document the desire to keep state serializable.

@yoshuawuyts
Copy link
Member Author

But yeah, we should probably document the desire to keep state serializable.

yeah, we should probably write a test for that too. I'll do that in a separate patch.

@yoshuawuyts yoshuawuyts merged commit b1fa6f1 into master Mar 14, 2018
@yoshuawuyts yoshuawuyts deleted the pure-state branch March 14, 2018 11:25
@yoshuawuyts
Copy link
Member Author

v6.10.3

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.

5 participants