avvosmeyz
Reacting to a store change outside the context of a root or render function
I have a user store to manage user token etc.
global-store.ts
I'm also experimenting with the library called wretch.
linkerly-api.ts
After a successful login I am setting the user store.
The question is if I don't wrap the in a createEffect it's not reactive and auth token doesn't get injected into the http client. If I wrap it I am getting 'computations created outside a
createRoot
or render
will never be disposed'. Felt like I am doing something that's not supposed to do or recomennded and there should be a better way to do all of these. Any idea?2 replies