SolidJSS
SolidJS13mo ago
5 replies
JonathanExcelsior

createSignal vs createStore

When should createSignal be used instead of createStore and vice versa?

If I want to store an object in state, for example:
const user = {
  name: "john",
  role: "admin",
  active: true,
}


Which is preferable, createSignal or createStore? Is there any performance benefits in using one over the other? Should createSignal only be used for primitive data types and createStore for complex data types? Should createStore only be used if you want nested reactivity?

I'm just trying to understand when best to use each.
Was this page helpful?