createStore causing warning
I am using
createStore
for a lot of my app, to reduce prop drilling and make inter-component communication a lot easier. I will preface, my app works exactly as intended. No bugs or issues that i can see (currently) - however i get this warning due to my createStore
structure.
This is an example store:
src/store/mdns/index.ts
src/store/mdns/selectors.ts
7 Replies
Essentially i have my
getters
in selectors.ts
and my setters
in the index.ts
for that store.
I am creating these objects outside of a createRoot
and a render
inside of some files, then i import the getters
and setters
through out my app as i need them. The store acts as a "global cache" for my project - where needed. What is the proper way to do this, instead?You could use a context instead
that seems overly cumbersome tbh
I tried a context
it felt bloated and was a pain to work with
Tbh, your method is fine otherwise I think
so iam not leaking memory or something?
I mean, i haven't seen it in the app profiling - but i just figured i might be doing something that could affect performance.
From what I understand, if it's a SPA then all the stuff would be disposed of anyway once the tab is closed
There is another way to do it, since it has been asked before, but I can't remember it off the top of my head at the moment
yeah, it is. No ssr or anything special. Just a
tauri
app and this is the front-end logic.