ctx-core 4.11.3 → 4.12.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_/index.d.ts +1 -1
- package/all/be_/index.js +4 -4
- package/all/be_/index.test.ts +2 -2
- package/package.json +2 -2
package/all/be_/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const pending_symbol:unique symbol
|
|
|
2
2
|
export declare function globalThis__be_<
|
|
3
3
|
val_T,
|
|
4
4
|
ctx_T extends Ctx = Ctx
|
|
5
|
-
>(
|
|
5
|
+
>(val__new:be__val__new_T<val_T, ctx_T>, config:be_config_T&{ id: string }):Be<val_T, ctx_T>
|
|
6
6
|
/**
|
|
7
7
|
* Auto-memoization function for the Ctx.
|
|
8
8
|
*
|
package/all/be_/index.js
CHANGED
|
@@ -14,13 +14,13 @@ import { globalThis__prop__ensure } from '../globalThis__prop__ensure/index.js'
|
|
|
14
14
|
* otherwise it caches & uses the return value of val__new.
|
|
15
15
|
* @param {string|symbol}id
|
|
16
16
|
* @param {be__val__new_T}val__new
|
|
17
|
-
* @param {be_config_T}
|
|
17
|
+
* @param {be_config_T}config
|
|
18
18
|
* @returns {Be}
|
|
19
19
|
* @private
|
|
20
20
|
*/
|
|
21
|
-
export function globalThis__be_(
|
|
22
|
-
return globalThis__prop__ensure(id, ()=>
|
|
23
|
-
be_(val__new,
|
|
21
|
+
export function globalThis__be_(val__new, config) {
|
|
22
|
+
return globalThis__prop__ensure(config.id, ()=>
|
|
23
|
+
be_(val__new, config))
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Auto-memoization function for the Ctx.
|
package/all/be_/index.test.ts
CHANGED
|
@@ -19,11 +19,11 @@ test.after(()=>{
|
|
|
19
19
|
test('globalThis__be_', ()=>{
|
|
20
20
|
const ctx = ctx__new()
|
|
21
21
|
equal(root_be_(), undefined)
|
|
22
|
-
const be = globalThis__be_('root_be'
|
|
22
|
+
const be = globalThis__be_(()=>1, { id: 'root_be' })
|
|
23
23
|
equal(root_be_(), be)
|
|
24
24
|
equal(root_be_()!(ctx), 1)
|
|
25
25
|
equal(be(ctx), 1)
|
|
26
|
-
const be2 = globalThis__be_('root_be'
|
|
26
|
+
const be2 = globalThis__be_(()=>1, { id: 'root_be' })
|
|
27
27
|
equal(be2, be)
|
|
28
28
|
equal(root_be_(), be2)
|
|
29
29
|
equal(root_be_()!(ctx), 1)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ctx-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "ctx-core core library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"import": {
|
|
143
143
|
"./be": "{ be_, ctx_ }"
|
|
144
144
|
},
|
|
145
|
-
"limit": "
|
|
145
|
+
"limit": "187 B"
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
"name": "memo_",
|