ECOSYSTEM / STORE
Reference
Every public name of janelkit-store.
Ecosystem package
janelkit-store Shared application data: stores with actions, controlled writes and change tracking, one instance per application, and persistence. pip install janelkit-storeAlpha / 0.2 — These pages document JanelKit 0.2 and its packages. Each series (0.1, 0.2…) may change the public API, always with migration notes: see Changes and migration. The website uses Svelte; the desktop examples use Python and JanelKit, not JavaScript.
Public names
Import them from janelkit_store.
| Name | Description |
|---|---|
| store | Class decorator: @store, @store(strict=True, persist="key"). |
| field | field(default, bind=False, persist=True): a field with options. |
| use | use(Class, key=None): the instance of the running application. Without one, StoreError. |
| subscribe | subscribe(instance, fn) -> cancel: fn(mutation) after each action that changes something. |
| snapshot | snapshot(instance) -> dict: a copy of the public fields. |
| reset | reset(instance): the fields return to their defaults (an action named reset). |
| mutations | mutations(): the mutations of the running application. |
| Mutation | What subscribers receive: store, key, action, changes. |
| Change | One field of a Mutation: field, kind ("set" or "mutate"), old, new. |
| StoreError | A write outside an action in a strict store, use() without an application, a class declared wrongly. |
| persisted | persisted(key, initial): a state that is remembered between launches. The same key gives the same object. |
| Persisted | The type of persisted: a State with key, file and flush(). |
English documentation based on the JanelKit source. For additional details, browse the source docs ↗.