invokeAI-docs

State Management

The app makes heavy use of Redux Toolkit, its Query library, and nanostores.

Redux

TODO

nanostores

nanostores is a tiny state management library. It provides both imperative and declarative APIs.

Example

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);

Where to put nanostores

When to use nanostores