Skip to content

State structure and organization when using signals #673

Answered by rschristian
rawrmonstar asked this question in Q&A
Discussion options

You must be logged in to vote

Signals right now feel to me like alternatives to useState instead of a larger state management library.

That's essentially the goal, yes. Signals are a new state primitive (well, new to preact/react) and as such are best compared to the existing state primitives like useState. Redux and MST are opinionated tools that build upon existing primitives, hence why they come with such strong suggestions around patterns. They work on a different layer to signals.

Classes (both for components or just data models) work really well with signals and quite a few of us use them very heavily throughout our apps. Can then stick the class instance into a context provider to access it from anywhere with…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rawrmonstar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants