@jay-framework/runtime 0.16.1 → 0.16.3
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/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -557,7 +557,7 @@ declare function clearGlobalContextRegistry(): void;
|
|
|
557
557
|
* Internal API used by findContext.
|
|
558
558
|
*/
|
|
559
559
|
declare function useGlobalContext<ContextType>(marker: ContextMarker<ContextType>): ContextType | undefined;
|
|
560
|
-
declare function createJayContext<ContextType = unknown>(): ContextMarker<ContextType>;
|
|
560
|
+
declare function createJayContext<ContextType = unknown>(name: string): ContextMarker<ContextType>;
|
|
561
561
|
declare function withContext<ContextType, Returns>(marker: ContextMarker<ContextType>, context: ContextType, callback: () => Returns): Returns;
|
|
562
562
|
declare function useContext<ContextType>(marker: ContextMarker<ContextType>): ContextType;
|
|
563
563
|
declare function findContext<ContextType>(predicate: (marker: ContextMarker<ContextType>) => boolean): ContextType | undefined;
|
package/dist/index.js
CHANGED
|
@@ -115,8 +115,8 @@ function clearGlobalContextRegistry() {
|
|
|
115
115
|
function useGlobalContext(marker) {
|
|
116
116
|
return globalContextRegistry.get(marker);
|
|
117
117
|
}
|
|
118
|
-
function createJayContext() {
|
|
119
|
-
return Symbol();
|
|
118
|
+
function createJayContext(name) {
|
|
119
|
+
return Symbol.for("jay:" + name);
|
|
120
120
|
}
|
|
121
121
|
function withContext(marker, context, callback) {
|
|
122
122
|
let aContext = NewContextStack(context, marker, currentContext);
|
|
@@ -159,7 +159,7 @@ function restoreContext(savedContext, callback) {
|
|
|
159
159
|
currentContext = aContext;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
const CONSTRUCTION_CONTEXT_MARKER = createJayContext();
|
|
162
|
+
const CONSTRUCTION_CONTEXT_MARKER = createJayContext("ccm");
|
|
163
163
|
function currentConstructionContext() {
|
|
164
164
|
return useContext(CONSTRUCTION_CONTEXT_MARKER);
|
|
165
165
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/runtime",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"test:watch": "vitest"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@jay-framework/list-compare": "^0.16.
|
|
27
|
-
"@jay-framework/reactive": "^0.16.
|
|
26
|
+
"@jay-framework/list-compare": "^0.16.3",
|
|
27
|
+
"@jay-framework/reactive": "^0.16.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@jay-framework/dev-environment": "^0.16.
|
|
30
|
+
"@jay-framework/dev-environment": "^0.16.3",
|
|
31
31
|
"@testing-library/jest-dom": "^6.2.0",
|
|
32
32
|
"@types/jsdom": "^21.1.6",
|
|
33
33
|
"@types/node": "^20.11.5",
|