| method | Description | Example |
|---|---|---|
| get() | Get the current snapshot of the store state. | |
| set(state) | Update store state. It merges shallowly. | |
| pick(...keys) | Select required state values. It throws immediately if any requested key is null or undefined. | |
Get the current snapshot of the store state.
Update store state. It merges shallowly.
Select required state values. It throws immediately if any requested key is null or undefined.
| field | Description |
|---|---|
| st.<model>: Full | null | The cached full model instance. |
| st.<model>Loading: string | boolean | Loading status for the model instance. |
| st.<model>Form: Default | Form state for create or update flows. |
| st.<model>FormLoading: string | boolean | Loading status for form submission. |
| st.<model>Submit: Submit | Latest submit state. |
| st.<model>ViewAt: Date | Time when the detailed view was opened. |
| st.<model>Modal: string | null | Modal key associated with this model. |
The cached full model instance.
Loading status for the model instance.
Form state for create or update flows.
Loading status for form submission.
Latest submit state.
Time when the detailed view was opened.
Modal key associated with this model.
| method | Description |
|---|---|
| create<Class>InForm(options?) | Create a document using form state. |
| update<Class>InForm(options?) | Update a document using form state. |
| create<Class>(data, options?) | Create a new document with data. |
| update<Class>(id, data, options?) | Update an existing document. |
| remove<Class>(id, options?) | Remove a document. |
| check<Class>Submitable(disabled?) | Check whether the form can be submitted. |
| submit<Class>(options?) | Submit the form for create or update. |
| new<Class>(partial?, options?) | Initialize form state for creation. |
| edit<Class>(model, options?) | Initialize form state for editing. |
| merge<Class>(model, data, options?) | Merge data into an existing cached document. |
| view<Class>(model, options?) | Open detailed view state. |
| set<Class>(...models) | Manually set model cache. |
| reset<Class>(model?) | Reset model state. |
Create a document using form state.
Update a document using form state.
Create a new document with data.
Update an existing document.
Remove a document.
Check whether the form can be submitted.
Submit the form for create or update.
Initialize form state for creation.
Initialize form state for editing.
Merge data into an existing cached document.
Open detailed view state.
Manually set model cache.
Reset model state.
| field | Description |
|---|---|
| st.default<Class>: Default | Default value for the slice. |
| st.<slice>List: DataList<Light> | List loaded by init or refresh. |
| st.<slice>ListLoading: boolean | Loading status of the list. |
| st.<slice>InitList: DataList<Light> | Initial list snapshot. |
| st.<slice>InitAt: Date | Time when the list was initialized. |
| st.<slice>Selection: DataList<Light> | Selected items in the list. |
| st.<slice>Insight: Insight | Insight data for the list. |
| st.lastPageOf<Slice>: number | Last accessed page number. |
| st.pageOf<Slice>: number | Current page number. |
| st.limitOf<Slice>: number | Items per page. |
| st.queryArgsOf<Slice>: QueryArgs | Current query arguments. |
| st.sortOf<Slice>: Sort | Current sort setting. |
Default value for the slice.
List loaded by init or refresh.
Loading status of the list.
Initial list snapshot.
Time when the list was initialized.
Selected items in the list.
Insight data for the list.
Last accessed page number.
Current page number.
Items per page.
Current query arguments.
Current sort setting.
| method | Description |
|---|---|
| init<Slice>(...args) | Initialize list with query args. |
| refresh<Slice>(initForm?) | Reload list with strict consistency. |
| select<Slice>(model, options?) | Update selection state. |
| setPageOf<Slice>(page, options?) | Change page and reload. |
| addPageOf<Slice>(page, options?) | Load next page and append. |
| setLimitOf<Slice>(limit, options?) | Change list limit and reload. |
| setQueryArgsOf<Slice>(...args) | Change query arguments and reload. |
| setSortOf<Slice>(sort, options?) | Change sort and reload. |
Initialize list with query args.
Reload list with strict consistency.
Update selection state.
Change page and reload.
Load next page and append.
Change list limit and reload.
Change query arguments and reload.
Change sort and reload.
