docs/contributing/frontend/state-management.md
The app makes heavy use of Redux Toolkit, its Query library, and nanostores.
We use RTK extensively - slices, entity adapters, queries, reselect, the whole 9 yards. Their docs are excellent.
nanostoresnanostores is a tiny state management library. It provides both imperative and declarative APIs.
export const $myStringOption = atom<string | null>(null);
// Outside a component, or within a callback for performance-critical logic
$myStringOption.get();
$myStringOption.set('new value');
// Inside a component
const myStringOption = useStore($myStringOption);
invokeai/frontend/web/src/app/store/nanostores/.invokeai/frontend/web/src/features/myFeature/myFeatureNanostores.ts).nanostores instead of a global.nanostores instead of redux.nanostores if there's a measurable performance issue.