ctx-core 5.22.0 → 5.23.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.
- package/all/be_lock_memosig_triple/index.d.ts +10 -10
- package/all/be_lock_memosig_triple/index.test.ts +4 -9
- package/all/be_memo_pair/index.d.ts +10 -10
- package/all/be_memo_pair/index.test.ts +3 -4
- package/all/be_memosig_triple/index.d.ts +10 -10
- package/all/be_memosig_triple/index.test.ts +3 -6
- package/all/be_sig_triple/index.d.ts +9 -9
- package/all/be_sig_triple/index.test.ts +4 -7
- package/all/rmemo/index.d.ts +33 -29
- package/all/rmemo/index.test.ts +3 -2
- package/package.json +251 -252
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import type { Be, be_config_T,
|
|
1
|
+
import type { Be, be_config_T, ctx__be_T, ctx__get_T, ctx__set_T, Ctx_wide_T, } from '../be_/index.js'
|
|
2
2
|
import type { lock_memosig_T } from '../rmemo/index.js'
|
|
3
3
|
export declare function be_lock_memosig_triple_<
|
|
4
4
|
val_T,
|
|
5
5
|
ns_T extends string = '',
|
|
6
|
-
|
|
6
|
+
E = unknown,
|
|
7
7
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
8
|
-
>(be:Be<
|
|
8
|
+
>(be:Be<lock_memosig_T<val_T, E>, ns_T, ctx_T>):be_lock_memosig_triple_T<val_T, ns_T, E, ctx_T>
|
|
9
9
|
export declare function be_lock_memosig_triple_<
|
|
10
10
|
val_T,
|
|
11
11
|
ns_T extends string = '',
|
|
12
|
-
|
|
12
|
+
E = unknown,
|
|
13
13
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
14
14
|
>(
|
|
15
|
-
rmemo__new:(ctx:ctx_T, memosig:
|
|
15
|
+
rmemo__new:(ctx:ctx_T, memosig:lock_memosig_T<val_T, E>)=>val_T,
|
|
16
16
|
config?:be_config_T<ns_T>
|
|
17
|
-
):be_lock_memosig_triple_T<val_T, ns_T,
|
|
17
|
+
):be_lock_memosig_triple_T<val_T, ns_T, E, ctx_T>
|
|
18
18
|
export type be_lock_memosig_triple_T<
|
|
19
19
|
val_T,
|
|
20
20
|
ns_T extends string = '',
|
|
21
|
-
|
|
21
|
+
E = unknown,
|
|
22
22
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
23
23
|
> = [
|
|
24
|
-
ctx__be_T<
|
|
24
|
+
ctx__be_T<lock_memosig_T<val_T, E>, ns_T, ctx_T>,
|
|
25
25
|
ctx__get_T<val_T, ns_T, ctx_T>,
|
|
26
26
|
ctx__set_T<val_T, ns_T, ctx_T>,
|
|
27
27
|
]&{
|
|
28
28
|
add<add_val_T>(
|
|
29
|
-
add_def:(ctx:ctx_T, sig:
|
|
30
|
-
):be_lock_memosig_triple_T<val_T, ns_T,
|
|
29
|
+
add_def:(ctx:ctx_T, sig:lock_memosig_T<val_T, E>)=>add_val_T
|
|
30
|
+
):be_lock_memosig_triple_T<val_T, ns_T, E, ctx_T>
|
|
31
31
|
}
|
|
@@ -16,9 +16,7 @@ test('be_lock_memosig_triple_', ()=>{
|
|
|
16
16
|
foobar$_,
|
|
17
17
|
foobar_,
|
|
18
18
|
foobar__set,
|
|
19
|
-
] = be_lock_memosig_triple_<number, '',
|
|
20
|
-
count:number
|
|
21
|
-
}>((
|
|
19
|
+
] = be_lock_memosig_triple_<number, '', { count:number }>((
|
|
22
20
|
_ctx,
|
|
23
21
|
foobar$
|
|
24
22
|
)=>{
|
|
@@ -110,19 +108,19 @@ test('be_lock_memosig_triple_|+be', ()=>{
|
|
|
110
108
|
foobar$_,
|
|
111
109
|
foobar_,
|
|
112
110
|
foobar__set,
|
|
113
|
-
] = be_lock_memosig_triple_<number, 'test_ns',
|
|
111
|
+
] = be_lock_memosig_triple_<number, 'test_ns', { custom: string }>(
|
|
114
112
|
be_(ctx=>{
|
|
115
113
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
116
114
|
type test_ctx = Expect<Equal<typeof ctx, Ctx_wide_T<'test_ns'>>>
|
|
117
115
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
118
116
|
const foobar$ =
|
|
119
|
-
memosig_(
|
|
117
|
+
memosig_<number, { custom: string }>(
|
|
120
118
|
()=>base_(ctx) + 1
|
|
121
119
|
).add(foobar$=>
|
|
122
120
|
memo_(()=>{
|
|
123
121
|
foobar$()
|
|
124
122
|
add_count++
|
|
125
|
-
}))
|
|
123
|
+
}))
|
|
126
124
|
foobar$.custom = 'custom-val'
|
|
127
125
|
return foobar$
|
|
128
126
|
}, { id: 'foobar', ns: 'test_ns' }))
|
|
@@ -152,6 +150,3 @@ test('be_lock_memosig_triple_|+be', ()=>{
|
|
|
152
150
|
equal(add_count, 3)
|
|
153
151
|
})
|
|
154
152
|
test.run()
|
|
155
|
-
type custom_sig_T = sig_T<number>&{
|
|
156
|
-
custom:string
|
|
157
|
-
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import type { Be, be_config_T,
|
|
1
|
+
import type { Be, be_config_T, ctx__be_T, ctx__get_T, Ctx_wide_T } from '../be_/index.js'
|
|
2
2
|
import type { memo_T, sig_T } from '../rmemo/index.js'
|
|
3
3
|
export declare function be_memo_pair_<
|
|
4
4
|
val_T,
|
|
5
5
|
ns_T extends string = '',
|
|
6
|
-
|
|
6
|
+
E = unknown,
|
|
7
7
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
8
|
-
>(be:Be<
|
|
8
|
+
>(be:Be<memo_T<val_T, E>, ns_T, ctx_T>):be_memo_pair_T<val_T, ns_T, E, ctx_T>
|
|
9
9
|
export declare function be_memo_pair_<
|
|
10
10
|
val_T,
|
|
11
11
|
ns_T extends string = '',
|
|
12
|
-
|
|
12
|
+
E = unknown,
|
|
13
13
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
14
14
|
>(
|
|
15
|
-
rmemo__new:(ctx:ctx_T, memo:
|
|
15
|
+
rmemo__new:(ctx:ctx_T, memo:sig_T<val_T, E>)=>val_T,
|
|
16
16
|
config?:be_config_T
|
|
17
|
-
):be_memo_pair_T<val_T, ns_T,
|
|
17
|
+
):be_memo_pair_T<val_T, ns_T, E, ctx_T>
|
|
18
18
|
export type be_memo_pair_T<
|
|
19
19
|
val_T,
|
|
20
20
|
ns_T extends string = '',
|
|
21
|
-
|
|
21
|
+
E = unknown,
|
|
22
22
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
23
23
|
> = [
|
|
24
|
-
ctx__be_T<
|
|
24
|
+
ctx__be_T<memo_T<val_T, E>, ns_T, ctx_T>,
|
|
25
25
|
ctx__get_T<val_T, ns_T, ctx_T>,
|
|
26
26
|
]&{
|
|
27
27
|
add<add_val_T>(
|
|
28
|
-
add_def:(ctx:ctx_T, sig:sig_T<val_T
|
|
29
|
-
):be_memo_pair_T<val_T, ns_T,
|
|
28
|
+
add_def:(ctx:ctx_T, sig:sig_T<val_T, E>)=>add_val_T
|
|
29
|
+
):be_memo_pair_T<val_T, ns_T, E, ctx_T>
|
|
30
30
|
}
|
|
@@ -117,14 +117,14 @@ test('be_memo_pair_|be', ()=>{
|
|
|
117
117
|
const [
|
|
118
118
|
foobar$_,
|
|
119
119
|
foobar_,
|
|
120
|
-
] = be_memo_pair_<number, 'test_ns',
|
|
120
|
+
] = be_memo_pair_<number, 'test_ns', { custom: string }>(
|
|
121
121
|
be_(_ctx=>{
|
|
122
122
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
123
123
|
type test__ctx = Expect<Equal<typeof _ctx, Ctx_wide_T<'test_ns'>>>
|
|
124
124
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
125
|
-
const foobar$ = memo_(
|
|
125
|
+
const foobar$ = memo_<number, { custom: string }>(
|
|
126
126
|
()=>base_(ctx) + 1
|
|
127
|
-
).add(()=>add_count++)
|
|
127
|
+
).add(()=>add_count++)
|
|
128
128
|
equal(_ctx.s.test_ns, ctx.s.test_ns)
|
|
129
129
|
foobar$.custom = 'custom-val'
|
|
130
130
|
return foobar$
|
|
@@ -150,4 +150,3 @@ test('be_memo_pair_|be', ()=>{
|
|
|
150
150
|
equal(add_count, 1)
|
|
151
151
|
})
|
|
152
152
|
test.run()
|
|
153
|
-
type custom_memo_T = memo_T<number>&{ custom:string }
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import type { Be, be_config_T,
|
|
1
|
+
import type { Be, be_config_T, ctx__be_T, ctx__get_T, ctx__set_T, Ctx_wide_T } from '../be_/index.js'
|
|
2
2
|
import type { sig_T } from '../rmemo/index.js'
|
|
3
3
|
export declare function be_memosig_triple_<
|
|
4
4
|
val_T,
|
|
5
5
|
ns_T extends string = '',
|
|
6
|
-
|
|
6
|
+
E = unknown,
|
|
7
7
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
8
|
-
>(be:Be<
|
|
8
|
+
>(be:Be<sig_T<val_T, E>, ns_T, ctx_T>):be_memosig_triple_T<val_T, ns_T, E, ctx_T>
|
|
9
9
|
export declare function be_memosig_triple_<
|
|
10
10
|
val_T,
|
|
11
11
|
ns_T extends string = '',
|
|
12
|
-
|
|
12
|
+
E = unknown,
|
|
13
13
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
14
14
|
>(
|
|
15
|
-
rmemo__new:(ctx:ctx_T, memosig:
|
|
15
|
+
rmemo__new:(ctx:ctx_T, memosig:sig_T<val_T, E>)=>val_T,
|
|
16
16
|
config?:be_config_T<ns_T>
|
|
17
|
-
):be_memosig_triple_T<val_T, ns_T,
|
|
17
|
+
):be_memosig_triple_T<val_T, ns_T, E, ctx_T>
|
|
18
18
|
export type be_memosig_triple_T<
|
|
19
19
|
val_T,
|
|
20
20
|
ns_T extends string = '',
|
|
21
|
-
|
|
21
|
+
E = unknown,
|
|
22
22
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
23
23
|
> = [
|
|
24
|
-
ctx__be_T<
|
|
24
|
+
ctx__be_T<sig_T<val_T, E>, ns_T, ctx_T>,
|
|
25
25
|
ctx__get_T<val_T, ns_T, ctx_T>,
|
|
26
26
|
ctx__set_T<val_T, ns_T, ctx_T>,
|
|
27
27
|
]&{
|
|
28
28
|
add<add_val_T>(
|
|
29
|
-
add_def:(ctx:ctx_T, sig:
|
|
30
|
-
):be_memosig_triple_T<val_T, ns_T,
|
|
29
|
+
add_def:(ctx:ctx_T, sig:sig_T<val_T, E>)=>add_val_T
|
|
30
|
+
):be_memosig_triple_T<val_T, ns_T, E, ctx_T>
|
|
31
31
|
}
|
|
@@ -113,19 +113,19 @@ test('be_memosig_triple_|+be', ()=>{
|
|
|
113
113
|
foobar$_,
|
|
114
114
|
foobar_,
|
|
115
115
|
foobar__set,
|
|
116
|
-
] = be_memosig_triple_<number, 'test_ns',
|
|
116
|
+
] = be_memosig_triple_<number, 'test_ns', { custom: string }>(
|
|
117
117
|
be_(ctx=>{
|
|
118
118
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
119
119
|
type test_ctx = Expect<Equal<typeof ctx, Ctx_wide_T<'test_ns'>>>
|
|
120
120
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
121
121
|
const foobar$ =
|
|
122
|
-
memosig_(
|
|
122
|
+
memosig_<number, { custom: string }>(
|
|
123
123
|
()=>base_(ctx) + 1
|
|
124
124
|
).add(foobar$=>
|
|
125
125
|
memo_(()=>{
|
|
126
126
|
foobar$()
|
|
127
127
|
add_count++
|
|
128
|
-
}))
|
|
128
|
+
}))
|
|
129
129
|
foobar$.custom = 'custom-val'
|
|
130
130
|
return foobar$
|
|
131
131
|
}, { id: 'foobar', ns: 'test_ns' }))
|
|
@@ -155,6 +155,3 @@ test('be_memosig_triple_|+be', ()=>{
|
|
|
155
155
|
equal(add_count, 3)
|
|
156
156
|
})
|
|
157
157
|
test.run()
|
|
158
|
-
type custom_sig_T = sig_T<number>&{
|
|
159
|
-
custom:string
|
|
160
|
-
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import type { Be, be_config_T,
|
|
1
|
+
import type { Be, be_config_T, ctx__be_T, ctx__get_T, ctx__set_T, Ctx_wide_T } from '../be_/index.js'
|
|
2
2
|
import type { sig_T } from '../rmemo/index.js'
|
|
3
3
|
export declare function be_sig_triple_<
|
|
4
4
|
val_T,
|
|
5
5
|
ns_T extends string = '',
|
|
6
|
-
|
|
6
|
+
E = unknown,
|
|
7
7
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
8
|
-
>(be:Be<
|
|
8
|
+
>(be:Be<sig_T<val_T, E>, ns_T, ctx_T>):be_sig_triple_T<val_T, ns_T, E, ctx_T>
|
|
9
9
|
export declare function be_sig_triple_<
|
|
10
10
|
val_T,
|
|
11
11
|
ns_T extends string = '',
|
|
12
|
-
|
|
12
|
+
E = unknown,
|
|
13
13
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
14
14
|
>(
|
|
15
15
|
val__new:(ctx:ctx_T)=>val_T,
|
|
16
16
|
config?:be_config_T<ns_T>
|
|
17
|
-
):be_sig_triple_T<val_T, ns_T,
|
|
17
|
+
):be_sig_triple_T<val_T, ns_T, E, ctx_T>
|
|
18
18
|
export type be_sig_triple_T<
|
|
19
19
|
val_T,
|
|
20
20
|
ns_T extends string = '',
|
|
21
|
-
|
|
21
|
+
E = unknown,
|
|
22
22
|
ctx_T extends Ctx_wide_T<ns_T> = Ctx_wide_T<ns_T>,
|
|
23
23
|
> = [
|
|
24
|
-
ctx__be_T<
|
|
24
|
+
ctx__be_T<sig_T<val_T, E>, ns_T, ctx_T>,
|
|
25
25
|
ctx__get_T<val_T, ns_T, ctx_T>,
|
|
26
26
|
ctx__set_T<val_T, ns_T, ctx_T>,
|
|
27
27
|
]&{
|
|
28
28
|
add<add_val_T>(
|
|
29
|
-
add_def:(ctx:ctx_T, sig:
|
|
30
|
-
):be_sig_triple_T<val_T, ns_T,
|
|
29
|
+
add_def:(ctx:ctx_T, sig:sig_T<val_T, E>)=>add_val_T
|
|
30
|
+
):be_sig_triple_T<val_T, ns_T, E, ctx_T>
|
|
31
31
|
}
|
|
@@ -72,17 +72,17 @@ test('be_sig_triple_|+be', ()=>{
|
|
|
72
72
|
foobar$_,
|
|
73
73
|
foobar_,
|
|
74
74
|
foobar__set,
|
|
75
|
-
] = be_sig_triple_<number, 'test_ns',
|
|
75
|
+
] = be_sig_triple_<number, 'test_ns', { custom: string }>(
|
|
76
76
|
be_(ctx=>{
|
|
77
77
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
78
78
|
type test_ctx = Expect<Equal<typeof ctx, Ctx_wide_T<'test_ns'>>>
|
|
79
79
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
80
80
|
const foobar$ =
|
|
81
|
-
sig_(
|
|
81
|
+
sig_<number, { custom: string }>(
|
|
82
82
|
1
|
|
83
|
-
).add(()=>add_count++)
|
|
83
|
+
).add(()=>add_count++)
|
|
84
84
|
foobar$.custom = 'custom-val'
|
|
85
|
-
return foobar$
|
|
85
|
+
return foobar$
|
|
86
86
|
}, { id: 'foobar', ns: 'test_ns' }))
|
|
87
87
|
equal(add_count, 0)
|
|
88
88
|
equal(foobar$_(ns_ctx__new(ctx__new(), ctx))._, 1)
|
|
@@ -102,6 +102,3 @@ test('be_sig_triple_|+be', ()=>{
|
|
|
102
102
|
equal(add_count, 1)
|
|
103
103
|
})
|
|
104
104
|
test.run()
|
|
105
|
-
type custom_sig_T = sig_T<number>&{
|
|
106
|
-
custom:string
|
|
107
|
-
}
|
package/all/rmemo/index.d.ts
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
/// <reference lib="es2021" />
|
|
2
|
-
export declare function memo_<val_T>(def:memo_def_T<val_T>):memo_T<val_T>
|
|
3
|
-
export declare function sig_<val_T>(init_val:val_T):sig_T<val_T>
|
|
4
|
-
export declare function memosig_<val_T>(def:memo_def_T<val_T>):sig_T<val_T>
|
|
5
|
-
export declare function lock_memosig_<val_T>(def:memo_def_T<val_T>):sig_T<val_T>
|
|
6
|
-
export declare function memo__bind<A extends unknown[], R>(
|
|
2
|
+
export declare function memo_<val_T, E = unknown>(def:memo_def_T<val_T, E>):memo_T<val_T, E>
|
|
3
|
+
export declare function sig_<val_T, E = unknown>(init_val:val_T):sig_T<val_T, E>
|
|
4
|
+
export declare function memosig_<val_T, E = unknown>(def:memo_def_T<val_T, E>):sig_T<val_T, E>
|
|
5
|
+
export declare function lock_memosig_<val_T, E = unknown>(def:memo_def_T<val_T, E>):sig_T<val_T, E>
|
|
6
|
+
export declare function memo__bind<A extends unknown[], R, E = unknown>(
|
|
7
7
|
fn:(...arg_a:A)=>R
|
|
8
8
|
):((...arg_a:A)=>R)&{
|
|
9
|
-
memo_<val_T>(def:memo_def_T<val_T>):memo_T<val_T>
|
|
9
|
+
memo_<val_T>(def:memo_def_T<val_T, E>):memo_T<val_T>
|
|
10
10
|
}
|
|
11
|
-
export declare function rmemo__on<val_T>(rmemo:rmemo_T<val_T>, off_fn?:(rmemo:rmemo_T<val_T>)=>unknown):void
|
|
12
|
-
export declare function rmemo__off<val_T>(rmemo:rmemo_T<val_T>):void
|
|
13
|
-
export declare function rmemo__off__add<val_T>(rmemo:rmemo_T<val_T>, off_fn:(rmemo:rmemo_T<val_T>)=>unknown):void
|
|
14
|
-
export declare function rmemo__add<val_T, listener_val_T>(
|
|
15
|
-
rmemo:rmemo_T<val_T>,
|
|
16
|
-
listener:(sig:sig_T<val_T>)=>listener_val_T
|
|
11
|
+
export declare function rmemo__on<val_T, E = unknown>(rmemo:rmemo_T<val_T, E>, off_fn?:(rmemo:rmemo_T<val_T, E>)=>unknown):void
|
|
12
|
+
export declare function rmemo__off<val_T, E = unknown>(rmemo:rmemo_T<val_T, E>):void
|
|
13
|
+
export declare function rmemo__off__add<val_T, E = unknown>(rmemo:rmemo_T<val_T>, off_fn:(rmemo:rmemo_T<val_T, E>)=>unknown):void
|
|
14
|
+
export declare function rmemo__add<val_T, listener_val_T, E = unknown>(
|
|
15
|
+
rmemo:rmemo_T<val_T, E>,
|
|
16
|
+
listener:(sig:sig_T<val_T, E>)=>listener_val_T
|
|
17
17
|
):()=>void
|
|
18
|
-
export type rmemo_T<val_T> = memo_T<val_T>|sig_T<val_T>|lock_memosig_T<val_T>
|
|
19
|
-
export type circular_rmemo_T =
|
|
20
|
-
|
|
18
|
+
export type rmemo_T<val_T, E = unknown> = memo_T<val_T, E>|sig_T<val_T, E>|lock_memosig_T<val_T, E>
|
|
19
|
+
export type circular_rmemo_T<E = unknown> =
|
|
20
|
+
(circular_memo_T|circular_sig_T|circular_lock_memosig_T)&E
|
|
21
|
+
export type memo_T<val_T, E = unknown> = (()=>val_T)&{
|
|
21
22
|
readonly _:val_T
|
|
22
23
|
readonly a?:rmemo_a_T[]
|
|
23
24
|
readonly f?:rmemo_f_T
|
|
@@ -27,12 +28,13 @@ export type memo_T<val_T> = (()=>val_T)&{
|
|
|
27
28
|
readonly u:rmemo_T<unknown>[]
|
|
28
29
|
readonly v:rmemo_T<unknown>[]
|
|
29
30
|
readonly val:val_T
|
|
30
|
-
add<add_val_T>(add_def:rmemo_add_def_T<val_T, add_val_T>):memo_T<val_T>
|
|
31
|
-
memo_<_val_T>(def:memo_def_T<_val_T>):memo_T<_val_T>
|
|
31
|
+
add<add_val_T>(add_def:rmemo_add_def_T<val_T, add_val_T>):memo_T<val_T, E>
|
|
32
|
+
memo_<_val_T, E = unknown>(def:memo_def_T<_val_T>):memo_T<_val_T, E>
|
|
33
|
+
}&E
|
|
34
|
+
interface _circular_memo_T extends memo_T<_circular_memo_T> {
|
|
32
35
|
}
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
export type sig_T<val_T> = (()=>val_T)&{
|
|
36
|
+
export type circular_memo_T<E = unknown> = _circular_memo_T&E
|
|
37
|
+
export type sig_T<val_T, E = unknown> = (()=>val_T)&{
|
|
36
38
|
_:val_T
|
|
37
39
|
readonly a?:rmemo_a_T
|
|
38
40
|
readonly f?:rmemo_f_T
|
|
@@ -42,22 +44,24 @@ export type sig_T<val_T> = (()=>val_T)&{
|
|
|
42
44
|
readonly u:rmemo_T<unknown>[]
|
|
43
45
|
readonly v:rmemo_T<unknown>[]
|
|
44
46
|
readonly val:val_T
|
|
45
|
-
add<add_val_T>(fn:rmemo_add_def_T<val_T, add_val_T>):sig_T<val_T>
|
|
46
|
-
memo_<_val_T>(def:memo_def_T<_val_T>):memo_T<_val_T>
|
|
47
|
-
}
|
|
48
|
-
|
|
47
|
+
add<add_val_T>(fn:rmemo_add_def_T<val_T, add_val_T>):sig_T<val_T, E>
|
|
48
|
+
memo_<_val_T, E = unknown>(def:memo_def_T<_val_T>):memo_T<_val_T, E>
|
|
49
|
+
}&E
|
|
50
|
+
interface _circular_sig_T extends sig_T<_circular_sig_T> {
|
|
49
51
|
}
|
|
50
|
-
export type
|
|
52
|
+
export type circular_sig_T<E = unknown> = _circular_memo_T&E
|
|
53
|
+
export type lock_memosig_T<val_T, E = unknown> = sig_T<val_T, {
|
|
51
54
|
lock?:0|1
|
|
55
|
+
}&E>
|
|
56
|
+
interface _circular_lock_memosig_T extends lock_memosig_T<_circular_lock_memosig_T> {
|
|
52
57
|
}
|
|
53
|
-
export
|
|
54
|
-
}
|
|
58
|
+
export type circular_lock_memosig_T<E = unknown> = _circular_lock_memosig_T&E
|
|
55
59
|
export type rmemo_val_T<sig_T> = sig_T extends { ():infer val_T }
|
|
56
60
|
? val_T
|
|
57
61
|
: unknown
|
|
58
|
-
export type memo_def_T<val_T> = (sig:sig_T<val_T>)=>val_T
|
|
62
|
+
export type memo_def_T<val_T, E = unknown> = (sig:sig_T<val_T, E>)=>val_T
|
|
59
63
|
export type rmemo_a_T = unknown[]
|
|
60
|
-
export type rmemo_add_def_T<val_T, add_val_T> = (sig:sig_T<val_T>)=>add_val_T
|
|
64
|
+
export type rmemo_add_def_T<val_T, add_val_T, E = unknown> = (sig:sig_T<val_T, E>)=>add_val_T
|
|
61
65
|
export type rmemo_f_T = (()=>void)&{
|
|
62
66
|
// readonly l:number
|
|
63
67
|
// readonly s:rmemo_T<unknown>[]
|
package/all/rmemo/index.test.ts
CHANGED
|
@@ -31,8 +31,9 @@ test('memo_|static value', ()=>{
|
|
|
31
31
|
})
|
|
32
32
|
test('memo_|def function|rmemo argument', ()=>{
|
|
33
33
|
const sig = sig_('val0')
|
|
34
|
-
const memo
|
|
35
|
-
|
|
34
|
+
const memo =
|
|
35
|
+
memo_<string, { custom?:string }>(memo=>
|
|
36
|
+
`${memo.custom}-${sig()}`)
|
|
36
37
|
memo.custom = 'custom_val0'
|
|
37
38
|
equal(memo(), 'custom_val0-val0')
|
|
38
39
|
memo.custom = 'custom_val1'
|
package/package.json
CHANGED
|
@@ -1,254 +1,253 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
]
|
|
2
|
+
"name": "ctx-core",
|
|
3
|
+
"version": "5.23.0",
|
|
4
|
+
"description": "ctx-core core library",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ctx-core",
|
|
7
|
+
"array",
|
|
8
|
+
"combinators",
|
|
9
|
+
"function",
|
|
10
|
+
"object",
|
|
11
|
+
"set"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/ctx-core/ctx-core#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/ctx-core/ctx-core/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/ctx-core/ctx-core.git"
|
|
20
|
+
},
|
|
21
|
+
"license": "Apache-2.0",
|
|
22
|
+
"author": "Brian Takita",
|
|
23
|
+
"type": "module",
|
|
24
|
+
"files": [
|
|
25
|
+
"*.d.ts",
|
|
26
|
+
"*.js",
|
|
27
|
+
"*.json",
|
|
28
|
+
"all",
|
|
29
|
+
"array",
|
|
30
|
+
"atob",
|
|
31
|
+
"base16",
|
|
32
|
+
"be",
|
|
33
|
+
"btoa",
|
|
34
|
+
"buffer",
|
|
35
|
+
"chain",
|
|
36
|
+
"class",
|
|
37
|
+
"cli-args",
|
|
38
|
+
"color",
|
|
39
|
+
"combinators",
|
|
40
|
+
"crypto",
|
|
41
|
+
"currency",
|
|
42
|
+
"data",
|
|
43
|
+
"date",
|
|
44
|
+
"debounce",
|
|
45
|
+
"deep_equal",
|
|
46
|
+
"env",
|
|
47
|
+
"error",
|
|
48
|
+
"event_log",
|
|
49
|
+
"falsy",
|
|
50
|
+
"fetch",
|
|
51
|
+
"fibonacci",
|
|
52
|
+
"fs",
|
|
53
|
+
"function",
|
|
54
|
+
"functional",
|
|
55
|
+
"html",
|
|
56
|
+
"http",
|
|
57
|
+
"math",
|
|
58
|
+
"matrix",
|
|
59
|
+
"nullish",
|
|
60
|
+
"number",
|
|
61
|
+
"object",
|
|
62
|
+
"promise",
|
|
63
|
+
"queue",
|
|
64
|
+
"random",
|
|
65
|
+
"regex",
|
|
66
|
+
"rmemo",
|
|
67
|
+
"run",
|
|
68
|
+
"set",
|
|
69
|
+
"sleep",
|
|
70
|
+
"stream",
|
|
71
|
+
"string",
|
|
72
|
+
"tempfile",
|
|
73
|
+
"test",
|
|
74
|
+
"time",
|
|
75
|
+
"tuple",
|
|
76
|
+
"types",
|
|
77
|
+
"uri",
|
|
78
|
+
"uuid",
|
|
79
|
+
"package.json"
|
|
80
|
+
],
|
|
81
|
+
"exports": {
|
|
82
|
+
".": "./index.js",
|
|
83
|
+
"./all": "./all/index.js",
|
|
84
|
+
"./array": "./array/index.js",
|
|
85
|
+
"./atob": "./atob/index.js",
|
|
86
|
+
"./base16": "./base16/index.js",
|
|
87
|
+
"./be": "./be/index.js",
|
|
88
|
+
"./btoa": "./btoa/index.js",
|
|
89
|
+
"./buffer": "./buffer/index.js",
|
|
90
|
+
"./chain": "./chain/index.js",
|
|
91
|
+
"./class": "./class/index.js",
|
|
92
|
+
"./cli-args": "./cli-args/index.js",
|
|
93
|
+
"./color": "./color/index.js",
|
|
94
|
+
"./combinators": "./combinators/index.js",
|
|
95
|
+
"./crypto": "./crypto/index.js",
|
|
96
|
+
"./currency": "./currency/index.js",
|
|
97
|
+
"./data": "./data/index.js",
|
|
98
|
+
"./date": "./date/index.js",
|
|
99
|
+
"./debounce": "./debounce/index.js",
|
|
100
|
+
"./deep_equal": "./deep_equal/index.js",
|
|
101
|
+
"./env": "./env/index.js",
|
|
102
|
+
"./error": "./error/index.js",
|
|
103
|
+
"./event_log": "./event_log/index.js",
|
|
104
|
+
"./falsy": "./falsy/index.js",
|
|
105
|
+
"./fetch": "./fetch/index.js",
|
|
106
|
+
"./fibonacci": "./fibonacci/index.js",
|
|
107
|
+
"./fs": "./fs/index.js",
|
|
108
|
+
"./function": "./function/index.js",
|
|
109
|
+
"./functional": "./functional/index.js",
|
|
110
|
+
"./html": "./html/index.js",
|
|
111
|
+
"./http": "./http/index.js",
|
|
112
|
+
"./math": "./math/index.js",
|
|
113
|
+
"./matrix": "./matrix/index.js",
|
|
114
|
+
"./nullish": "./nullish/index.js",
|
|
115
|
+
"./number": "./number/index.js",
|
|
116
|
+
"./object": "./object/index.js",
|
|
117
|
+
"./promise": "./promise/index.js",
|
|
118
|
+
"./queue": "./queue/index.js",
|
|
119
|
+
"./random": "./random/index.js",
|
|
120
|
+
"./regex": "./regex/index.js",
|
|
121
|
+
"./rmemo": "./rmemo/index.js",
|
|
122
|
+
"./run": "./run/index.js",
|
|
123
|
+
"./set": "./set/index.js",
|
|
124
|
+
"./sleep": "./sleep/index.js",
|
|
125
|
+
"./stream": "./stream/index.js",
|
|
126
|
+
"./string": "./string/index.js",
|
|
127
|
+
"./tempfile": "./tempfile/index.js",
|
|
128
|
+
"./test": "./test/index.js",
|
|
129
|
+
"./time": "./time/index.js",
|
|
130
|
+
"./tuple": "./tuple/index.js",
|
|
131
|
+
"./types": "./types/index.js",
|
|
132
|
+
"./uri": "./uri/index.js",
|
|
133
|
+
"./uuid": "./uuid/index.js",
|
|
134
|
+
"./package.json": "./package.json"
|
|
135
|
+
},
|
|
136
|
+
"devDependencies": {
|
|
137
|
+
"@arethetypeswrong/cli": "^0.13.5",
|
|
138
|
+
"@ctx-core/preprocess": "^0.1.1",
|
|
139
|
+
"@size-limit/preset-small-lib": "^11.0.2",
|
|
140
|
+
"@types/node": "^20.11.5",
|
|
141
|
+
"@types/sinon": "^17.0.3",
|
|
142
|
+
"c8": "^9.1.0",
|
|
143
|
+
"check-dts": "^0.7.2",
|
|
144
|
+
"esbuild": "^0.19.11",
|
|
145
|
+
"esmock": "^2.6.2",
|
|
146
|
+
"sinon": "^17.0.1",
|
|
147
|
+
"size-limit": "^11.0.2",
|
|
148
|
+
"tsx": "^4.7.0",
|
|
149
|
+
"typescript": "next",
|
|
150
|
+
"uvu": "^0.5.6"
|
|
151
|
+
},
|
|
152
|
+
"publishConfig": {
|
|
153
|
+
"access": "public",
|
|
154
|
+
"cache": "~/.npm"
|
|
155
|
+
},
|
|
156
|
+
"sideEffects": false,
|
|
157
|
+
"size-limit": [
|
|
158
|
+
{
|
|
159
|
+
"name": "ctx_",
|
|
160
|
+
"import": {
|
|
161
|
+
"./be": "{ ctx_ }"
|
|
162
|
+
},
|
|
163
|
+
"limit": "33 B"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "ns_ctx_",
|
|
167
|
+
"import": {
|
|
168
|
+
"./be": "{ ns_ctx_ }"
|
|
169
|
+
},
|
|
170
|
+
"limit": "85 B"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"name": "be_",
|
|
174
|
+
"import": {
|
|
175
|
+
"./be": "{ be_ }"
|
|
176
|
+
},
|
|
177
|
+
"limit": "99 B"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "be_ ctx_",
|
|
181
|
+
"import": {
|
|
182
|
+
"./be": "{ be_, ctx_ }"
|
|
183
|
+
},
|
|
184
|
+
"limit": "131 B"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "be_ ns_ctx_",
|
|
188
|
+
"import": {
|
|
189
|
+
"./be": "{ be_, ctx_, ns_ctx_ }"
|
|
190
|
+
},
|
|
191
|
+
"limit": "190 B"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "be_ ctx_ ns_ctx_",
|
|
195
|
+
"import": {
|
|
196
|
+
"./be": "{ be_, ctx_, ns_ctx_ }"
|
|
197
|
+
},
|
|
198
|
+
"limit": "190 B"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "memo_",
|
|
202
|
+
"import": {
|
|
203
|
+
"./rmemo": "{ memo_ }"
|
|
204
|
+
},
|
|
205
|
+
"limit": "352 B"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"name": "memo_ sig_",
|
|
209
|
+
"import": {
|
|
210
|
+
"./rmemo": "{ sig_, memo_ }"
|
|
211
|
+
},
|
|
212
|
+
"limit": "370 B"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "memo_ sig_ be_ ctx_",
|
|
216
|
+
"import": {
|
|
217
|
+
"./rmemo": "{ sig_, memo_, be_, ctx_ }"
|
|
218
|
+
},
|
|
219
|
+
"limit": "471 B"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"name": "memo_ sig_ be_ ctx_ be_memo_pair_ be_sig_triple_",
|
|
223
|
+
"import": {
|
|
224
|
+
"./rmemo": "{ sig_, memo_, be_, ctx_, be_memo_pair_, be_sig_triple_ }"
|
|
225
|
+
},
|
|
226
|
+
"limit": "576 B"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"name": "uuid",
|
|
230
|
+
"import": {
|
|
231
|
+
"./uuid": "{ uuid_ }"
|
|
232
|
+
},
|
|
233
|
+
"limit": "39 B"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"name": "short uuid",
|
|
237
|
+
"import": {
|
|
238
|
+
"./uuid": "{ short_uuid_ }"
|
|
239
|
+
},
|
|
240
|
+
"limit": "116 B"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"scripts": {
|
|
244
|
+
"build": ":",
|
|
245
|
+
"clean": ":",
|
|
246
|
+
"exec": "$@",
|
|
247
|
+
"test": "pnpm run /^test:/",
|
|
248
|
+
"test:size": "size-limit",
|
|
249
|
+
"test:type": "check-dts",
|
|
250
|
+
"test:unit": "NODE_OPTIONS=--loader=esmock tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
|
|
251
|
+
"disable:test:coverage": "c8 pnpm test:unit"
|
|
252
|
+
}
|
|
254
253
|
}
|