Functions inside store VS outside store?
I want to know what best practice is.
I watched some solid youtube tutorials..
Some people put their functions 'get' , 'set' , or 'doSomething' inside store,
What's common way???
5 Replies
It depends on what you want to do, all those are fine
do you want to call the function or access the function and call it implicitly?
Do you use both pattern then?
I don't use either of them, I don't put functions in stores, I use stores for data only basically
Don't you need any functions to mutate store?
Do you use signal?
You have the functions outside the store
use the
setStore
function to update the store