TanStack Store for Applications #143
Replies: 2 comments
-
In my job, I use tanstack store for our app instead of other solution that we use before, because we need a custom way to do things right for our app. But we also refactor other part of the app who needs global store to use tanstack store because we don't want to have many dependencies to do the same things. For me the main feature that will be usefull is :
And why we select tanstack store and not other solutions? For the question how to handle app needs and library needs for API design, I agree with the message in the PR, for a library needs I understand the design but for an app perspective if the api is simple to use it's better. Maybe something like the design is framework agnostic ok, usage inside library like this new Store, new Derived, new Effect, but for app create primitives, link to the framework specific and use under the hood the api for library part => useStore, useDerived, useEffect etc |
Beta Was this translation helpful? Give feedback.
-
From an application perspective, using zustand alongside tanstack query / router is quite popular. Similarly, jotai has a nice wrapper around query - https://github.com/jotaijs/jotai-tanstack-query tanstack store could be a potential solution that well integrates in this kind of usecase |
Beta Was this translation helpful? Give feedback.
-
While working on #40 it became clear to me that
Store
has two different primary users:See, in libraries like TanStack Form/Table, it's really valuable to know when a
Derived
instance orEffect
is triggering a subscribe so we can know exactly when to remove them or add them back.For applications? Less important.
However, libraries also need to be framework agnostic where most applications are hooked into libraries.
So this is an open-ended question: How do we want to handle this discrepancy?
I don't just mean with these two APIs, either: We need to have a good backing philosophy for our projects to figure out how we want to treat apps that want to use TanStack Store vs libraries that need it.
Further, what value add does TanStack Start provide apps? What features are missing today that would be useful in TanStack Store as an app builder?
Let us know below 💖
Beta Was this translation helpful? Give feedback.
All reactions