@sigil-dev/runtime 0.7.1 → 0.7.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.
Files changed (2) hide show
  1. package/index.ts +14 -0
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -452,3 +452,17 @@ export function setContext<T>(key: ContextKey<T>, value: T): void {
452
452
  export function getContext<T>(key: ContextKey<T>): T {
453
453
  return getStore().get(key as unknown as symbol) as T;
454
454
  }
455
+
456
+ const _hydrationStack: ChildNode[][] = [];
457
+
458
+ export function pushHydrationNodes(nodes: ChildNode[]): void {
459
+ _hydrationStack.push(nodes);
460
+ }
461
+
462
+ export function popHydrationNodes(): void {
463
+ _hydrationStack.pop();
464
+ }
465
+
466
+ export function getHydrationNodes(): ChildNode[] {
467
+ return _hydrationStack[_hydrationStack.length - 1] ?? [];
468
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sigil-dev/runtime",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "0.7.1",
5
+ "version": "0.7.3",
6
6
  "description": "Runtime for the Sigil framework",
7
7
  "private": false,
8
8
  "devDependencies": {