@octanejs/tanstack-store 0.0.37 → 0.0.38

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/package.json +4 -4
  2. package/src/internal.ts +2 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/tanstack-store",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -41,7 +41,7 @@
41
41
  "@tanstack/store": "0.11.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "octane": "0.1.43"
44
+ "octane": "0.1.44"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@tanstack/react-store": "0.11.0",
@@ -57,8 +57,8 @@
57
57
  "react-dom": "19.2.3",
58
58
  "use-sync-external-store": "1.6.0",
59
59
  "vitest": "^4.1.10",
60
- "@octanejs/testing-library": "0.1.40",
61
- "octane": "0.1.43"
60
+ "@octanejs/testing-library": "0.1.41",
61
+ "octane": "0.1.44"
62
62
  },
63
63
  "scripts": {
64
64
  "test": "vitest run",
package/src/internal.ts CHANGED
@@ -2,32 +2,9 @@
2
2
  // per-call-site Symbol into calls made by compiled components; the binding
3
3
  // forwards that symbol and derives a distinct sub-slot for each hook it
4
4
  // composes.
5
- const subSlotCache = new Map<symbol, Map<string, symbol>>();
6
- const bareTagCache = new Map<string, symbol>();
5
+ import { createSubSlot } from 'octane';
7
6
 
8
- export function subSlot(slot: symbol | undefined, tag: string): symbol {
9
- if (slot === undefined) {
10
- let bare = bareTagCache.get(tag);
11
- if (bare === undefined) {
12
- bare = Symbol.for(`@octanejs/tanstack-store:${tag}`);
13
- bareTagCache.set(tag, bare);
14
- }
15
- return bare;
16
- }
17
-
18
- let byTag = subSlotCache.get(slot);
19
- if (byTag === undefined) {
20
- byTag = new Map();
21
- subSlotCache.set(slot, byTag);
22
- }
23
-
24
- let child = byTag.get(tag);
25
- if (child === undefined) {
26
- child = Symbol.for(`${slot.description ?? ''}:${tag}`);
27
- byTag.set(tag, child);
28
- }
29
- return child;
30
- }
7
+ export const subSlot = createSubSlot({ slotlessPrefix: '@octanejs/tanstack-store:' });
31
8
 
32
9
  export function splitSlot(args: unknown[]): [unknown[], symbol | undefined] {
33
10
  const tail = args[args.length - 1];