@wcstack/state 1.21.5 → 1.21.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +1 -0
- package/README.md +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.esm.js +640 -94
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -867,6 +867,7 @@ export default {
|
|
|
867
867
|
| `this.$resolve(path, indexes, value?)` | ワイルドカードパスを特定のインデックスで解決 |
|
|
868
868
|
| `this.$postUpdate(path)` | 指定パスの更新通知を手動で発行 |
|
|
869
869
|
| `this.$trackDependency(path)` | キャッシュ無効化のための依存関係を手動で登録 |
|
|
870
|
+
| `this.$untrackDependency(fn)` | fn 実行中の依存追跡を抑止して値を読む(`$trackDependency` と対称) |
|
|
870
871
|
| `this.$stateElement` | `IStateElement` インスタンスへのアクセス |
|
|
871
872
|
| `this.$1`, `this.$2`, ... | 現在のループインデックス(1始まりの命名、0始まりの値) |
|
|
872
873
|
|
package/README.md
CHANGED
|
@@ -867,6 +867,7 @@ Inside state objects (getters / methods), the following APIs are available via `
|
|
|
867
867
|
| `this.$resolve(path, indexes, value?)` | Resolve a wildcard path with specific indexes |
|
|
868
868
|
| `this.$postUpdate(path)` | Manually trigger update notification for a path |
|
|
869
869
|
| `this.$trackDependency(path)` | Manually register a dependency for cache invalidation |
|
|
870
|
+
| `this.$untrackDependency(fn)` | Read values inside fn without registering dependencies (symmetric to `$trackDependency`) |
|
|
870
871
|
| `this.$command.<name>` | Access a `CommandToken` declared in `$commandTokens` (see [Command Token](#command-token-method-binding)) |
|
|
871
872
|
| `this.$stateElement` | Access to the `IStateElement` instance |
|
|
872
873
|
| `this.$1`, `this.$2`, ... | Current loop index (1-based naming, 0-based value) |
|
package/dist/index.d.ts
CHANGED
|
@@ -440,6 +440,13 @@ interface WcsStateApi {
|
|
|
440
440
|
* computed getter 内で動的にパスを組み立てる場合に使用。
|
|
441
441
|
*/
|
|
442
442
|
$trackDependency(path: string): void;
|
|
443
|
+
/**
|
|
444
|
+
* コールバック実行中の依存追跡(動的依存・`$1` インデックス依存の登録)を
|
|
445
|
+
* 抑止して fn を実行し、その戻り値を返す(`$trackDependency` と対称)。
|
|
446
|
+
* リスト行 getter が「行外の単一値」を読みたいが、その値の変更で全行を
|
|
447
|
+
* 再評価させたくない場合に使う(該当行へ直接書き込む設計と組で用いる)。
|
|
448
|
+
*/
|
|
449
|
+
$untrackDependency<T>(fn: () => T): T;
|
|
443
450
|
/** `<wcs-state>` 要素への参照 */
|
|
444
451
|
readonly $stateElement: HTMLElement;
|
|
445
452
|
/**
|