ctx-core 4.16.0 → 4.17.0

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.
@@ -1,13 +1,13 @@
1
1
  import type { Be, be_config_T, Ctx } from '../be_/index.js'
2
- import type { rmemo_val_T, sig_T } from '../rmemo/index.js'
2
+ import type { rmemo_val_T, lock_memosig_T } from '../rmemo/index.js'
3
3
  export declare function be_lock_memosig_triple_<
4
4
  val_T,
5
- _sig_T extends sig_T<val_T> = sig_T<val_T>,
5
+ _sig_T extends lock_memosig_T<val_T> = lock_memosig_T<val_T>,
6
6
  ctx_T extends Ctx = Ctx
7
7
  >(be:Be<_sig_T, ctx_T>):be_lock_memosig_triple_T<val_T, _sig_T, ctx_T>
8
8
  export declare function be_lock_memosig_triple_<
9
9
  val_T,
10
- _sig_T extends sig_T<val_T> = sig_T<val_T>,
10
+ _sig_T extends lock_memosig_T<val_T> = lock_memosig_T<val_T>,
11
11
  ctx_T extends Ctx = Ctx
12
12
  >(
13
13
  rmemo__new:(ctx:Ctx, memosig:_sig_T)=>val_T,
@@ -17,7 +17,7 @@ export declare function be_lock_memosig_triple_<
17
17
  ):be_lock_memosig_triple_T<val_T, _sig_T, ctx_T>
18
18
  export declare function globalThis__be_lock_memosig_triple_<
19
19
  val_T,
20
- _sig_T extends sig_T<val_T> = sig_T<val_T>,
20
+ _sig_T extends lock_memosig_T<val_T> = lock_memosig_T<val_T>,
21
21
  ctx_T extends Ctx = Ctx
22
22
  >(
23
23
  rmemo__new:(ctx:Ctx, memosig:_sig_T)=>val_T,
@@ -26,7 +26,7 @@ export declare function globalThis__be_lock_memosig_triple_<
26
26
  ):be_lock_memosig_triple_T<val_T, _sig_T, ctx_T>
27
27
  export type be_lock_memosig_triple_T<
28
28
  val_T,
29
- _sig_T extends sig_T<val_T> = sig_T<val_T>,
29
+ _sig_T extends lock_memosig_T<val_T> = lock_memosig_T<val_T>,
30
30
  ctx_T extends Ctx = Ctx
31
31
  > = [
32
32
  Be<_sig_T>,
@@ -7,7 +7,7 @@ import { lock_memosig_ } from '../rmemo/index.js'
7
7
  /**
8
8
  * @param {Be<sig_T>|be__val__new_T<unknown>}be_OR_val__new
9
9
  * @param {rmemo_subscriber_T[]|[...rmemo_subscriber_T[], be_config_T]}subscriber_a_THEN_config
10
- * @returns {be_sig_triple_T}
10
+ * @returns {be_lock_memosig_triple_T}
11
11
  * @private
12
12
  */
13
13
  export function be_lock_memosig_triple_(
@@ -29,6 +29,9 @@ export type sig_T<val_T> = (()=>val_T)&{
29
29
  r?:WeakRef<()=>val_T>
30
30
  memor:WeakRef<()=>val_T>[]
31
31
  }
32
+ export type lock_memosig_T<val_T> = sig_T<val_T>&{
33
+ lock?:0|1
34
+ }
32
35
  export type rmemo_val_T<sig_T> = sig_T extends { ():infer val_T }
33
36
  ? val_T
34
37
  : unknown
@@ -88,12 +88,12 @@ export { memo_ as memosig_ }
88
88
  export function lock_memosig_(memo_def, ...subscriber_a) {
89
89
  return new Proxy(
90
90
  /** @type {sig_T} */memo_(memo=>
91
- memo.c ? memo._ : memo_def(memo),
91
+ memo.lock ? memo._ : memo_def(memo),
92
92
  ...subscriber_a),
93
93
  {
94
94
  set(memo, prop, val) {
95
95
  if (prop === '_') {
96
- memo.c = 1
96
+ memo.lock = 1
97
97
  memo._ = val
98
98
  }
99
99
  return 1
@@ -114,7 +114,6 @@ export function sig_(init_val, ...subscriber_a) {
114
114
  },
115
115
  ...subscriber_a)
116
116
  }
117
- // TODO: lock_memosig_
118
117
  /**
119
118
  * Call the rmemo & enable updates from it's parents.
120
119
  * @param {rmemo_T}rmemo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctx-core",
3
- "version": "4.16.0",
3
+ "version": "4.17.0",
4
4
  "description": "ctx-core core library",
5
5
  "keywords": [
6
6
  "ctx-core",