u
This commit is contained in:
@@ -1,3 +1,21 @@
|
||||
/**
|
||||
* @file artikelAutomat.js
|
||||
* @description In-memory reactive cache and mutator for full single-article
|
||||
* detail payloads (`GET /api/article/:sku`), with inflight request deduplication.
|
||||
*
|
||||
* Upstream Triggers:
|
||||
* - `sseAutomat`: Calls `reloadArticle(sku)` via `invalidateArticle(sku)` when an
|
||||
* `article-<sku>` SSE mutation event arrives.
|
||||
* - `authAutomat`: Subscribes to auth state changes — calls `actions.clear()` when
|
||||
* status transitions to `'anon'` (logout).
|
||||
* - UI / Routes: Calls `loadArticle(sku)` or mutations (`setName`, `setEans`,
|
||||
* `setBrand`, `setCategories`, `setPrices`, `setWeight`, etc.).
|
||||
*
|
||||
* Downstream Triggers:
|
||||
* - `articleIndexAutomat`: Calls `setArticleIndexName(sku, name)` on optimistic
|
||||
* article renames, and `articleIndexAutomat.actions.reset()` on mutation failure rollback.
|
||||
*/
|
||||
|
||||
import { Automat } from 'react-automat';
|
||||
import { article as articleApi } from '../api';
|
||||
import { requireDefined, requireObject } from '../utils/apiShape';
|
||||
|
||||
Reference in New Issue
Block a user