-
Notifications
You must be signed in to change notification settings - Fork 125
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
Usage with a SPA #11
Comments
Hi @formula349 , Thanks for great input! I can say that it is currently out of scope and I think we need a bit more experience before deciding something. What I can say for now is that it does add complexity. There is no longer a single point to define and use signals, you have to know at what path that signal is related to. I think it also would be more difficult to refactor such a signal. Maybe it is a better idea to have multiple cerebral instances? So if each site actually does not have anything to do with the other you could consider it "a different person". So you have two different top components where you inject two different cerebrals. Would that make sense? |
reading this issue again I think it breaks the architecture. Signals has no knowledge of state and that is important, they only request state changes. Though I do think we will meet issues with structuring larger applications, but I think we should wait to solve that until we have some more examples. So I am all for some sort of dividing signals and possibly an entrypath to state changes, but not base signals on a specific state. Again, let me know if you get into trouble and we can bring up a discussion on it :-) |
When using this framework with a single page application, how do you handle the unique state and signals used by each page within the application?
The state seems to be fairly easy to solve by nesting it within the app state and using a map to always refer to the current page state.
The signals seem to be the issue. There doesn't seem to be a concept of nested signals or signals attached to nodes within the tree. I was initially looking for some type of cursor like Baobab that I could select and perhaps attach signals to the cursor.
Then I could attach this cursor/cerebral sub-instance to the react component rendering the particular page and all of it's state and signals would be available.
Maybe this is a bad idea or way out of scope, but any guidance would be appreciated.
The text was updated successfully, but these errors were encountered: