SolidJSS
SolidJS10mo ago
42 replies
hyperknot

Does store setState check for equality before updating signals?

Does it make sense to manually check if a value is actually different before running setState/setStore? I mean, are reactions run even if the value is the same as it was before?

If not, does it make sense to make like a helper function, which wraps setState in an if block, and only runs it if it's actually needed?

Of course it wouldn't work on functions, etc. passed in, but I'm talking about basic cases, like setting strings or arrays of strings.
Was this page helpful?