SolidJSS
SolidJSโ€ข10mo agoโ€ข
10 replies
gsoutz

Why is this store change doesn't trigger a reactive computation

It looks like this:
 // Reactive state store that can update UI
  const [state, setState] = createStore<StoreState>({
    current: { state: 'boot' },
  });
  const setCurrent = (state: SomeState) => setState('current', state);

  createEffect(on(() => state.current, state => {
    console.log('yes', state)
  }))


Why this setCurrent, doesn't log anything except the first one?

https://playground.solidjs.com/anonymous/7671caaa-1e05-40b2-bc52-a79140047484
Quickly discover what the solid compiler will generate from your JSX template
Was this page helpful?