@tanstack/solid-store 0.5.7 → 0.6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/index.tsx"],"sourcesContent":["import { onCleanup } from 'solid-js'\nimport { createStore, reconcile } from 'solid-js/store'\nimport type { AnyUpdater, Store } from '@tanstack/store'\nimport type { Accessor } from 'solid-js'\n\nexport * from '@tanstack/store'\n\nexport type NoInfer<T> = [T][T extends any ? 0 : never]\n\nexport function useStore<\n TState,\n TSelected = NoInfer<TState>,\n TUpdater extends AnyUpdater = AnyUpdater,\n>(\n store: Store<TState, TUpdater>,\n selector: (state: NoInfer<TState>) => TSelected = (d) => d as any,\n): Accessor<TSelected> {\n const [slice, setSlice] = createStore({\n value: selector(store.state),\n })\n\n const unsub = store.subscribe(() => {\n const newValue = selector(store.state)\n setSlice('value', reconcile(newValue))\n })\n\n onCleanup(() => {\n unsub()\n })\n\n return () => slice.value\n}\n"],"names":["useStore","store","selector","d","slice","setSlice","createStore","value","state","unsub","subscribe","newValue","reconcile","onCleanup"],"mappings":";;;;;AASO,SAASA,SAKdC,QACAC,WAAmDC,CAAAA,MAAMA,GACpC;AACrB,QAAM,CAACC,OAAOC,QAAQ,IAAIC,oBAAY;AAAA,IACpCC,OAAOL,SAASD,OAAMO,KAAK;AAAA,EAAA,CAC5B;AAEKC,QAAAA,QAAQR,OAAMS,UAAU,MAAM;AAC5BC,UAAAA,WAAWT,SAASD,OAAMO,KAAK;AAC5B,aAAA,SAASI,kBAAUD,QAAQ,CAAC;AAAA,EAAA,CACtC;AAEDE,UAAAA,UAAU,MAAM;AACR,UAAA;AAAA,EAAA,CACP;AAED,SAAO,MAAMT,MAAMG;AACrB;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/index.tsx"],"sourcesContent":["import { onCleanup } from 'solid-js'\nimport { createStore, reconcile } from 'solid-js/store'\nimport type { AnyUpdater, Store } from '@tanstack/store'\nimport type { Accessor } from 'solid-js'\n\nexport * from '@tanstack/store'\n\n/**\n * @private\n */\nexport type NoInfer<T> = [T][T extends any ? 0 : never]\n\nexport function useStore<\n TState,\n TSelected = NoInfer<TState>,\n TUpdater extends AnyUpdater = AnyUpdater,\n>(\n store: Store<TState, TUpdater>,\n selector: (state: NoInfer<TState>) => TSelected = (d) => d as any,\n): Accessor<TSelected> {\n const [slice, setSlice] = createStore({\n value: selector(store.state),\n })\n\n const unsub = store.subscribe(() => {\n const newValue = selector(store.state)\n setSlice('value', reconcile(newValue))\n })\n\n onCleanup(() => {\n unsub()\n })\n\n return () => slice.value\n}\n"],"names":["useStore","store","selector","d","slice","setSlice","createStore","value","state","unsub","subscribe","newValue","reconcile","onCleanup"],"mappings":";;;;;AAYO,SAASA,SAKdC,QACAC,WAAmDC,CAAAA,MAAMA,GACpC;AACrB,QAAM,CAACC,OAAOC,QAAQ,IAAIC,oBAAY;AAAA,IACpCC,OAAOL,SAASD,OAAMO,KAAK;AAAA,EAAA,CAC5B;AAEKC,QAAAA,QAAQR,OAAMS,UAAU,MAAM;AAC5BC,UAAAA,WAAWT,SAASD,OAAMO,KAAK;AAC5B,aAAA,SAASI,kBAAUD,QAAQ,CAAC;AAAA,EAAA,CACtC;AAEDE,UAAAA,UAAU,MAAM;AACR,UAAA;AAAA,EAAA,CACP;AAED,SAAO,MAAMT,MAAMG;AACrB;;;;;;;;"}
@@ -1,5 +1,8 @@
1
1
  import { AnyUpdater, Store } from '@tanstack/store';
2
2
  import { Accessor } from 'solid-js';
3
3
  export * from '@tanstack/store';
4
+ /**
5
+ * @private
6
+ */
4
7
  export type NoInfer<T> = [T][T extends any ? 0 : never];
5
8
  export declare function useStore<TState, TSelected = NoInfer<TState>, TUpdater extends AnyUpdater = AnyUpdater>(store: Store<TState, TUpdater>, selector?: (state: NoInfer<TState>) => TSelected): Accessor<TSelected>;
@@ -1,5 +1,8 @@
1
1
  import { AnyUpdater, Store } from '@tanstack/store';
2
2
  import { Accessor } from 'solid-js';
3
3
  export * from '@tanstack/store';
4
+ /**
5
+ * @private
6
+ */
4
7
  export type NoInfer<T> = [T][T extends any ? 0 : never];
5
8
  export declare function useStore<TState, TSelected = NoInfer<TState>, TUpdater extends AnyUpdater = AnyUpdater>(store: Store<TState, TUpdater>, selector?: (state: NoInfer<TState>) => TSelected): Accessor<TSelected>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import { onCleanup } from 'solid-js'\nimport { createStore, reconcile } from 'solid-js/store'\nimport type { AnyUpdater, Store } from '@tanstack/store'\nimport type { Accessor } from 'solid-js'\n\nexport * from '@tanstack/store'\n\nexport type NoInfer<T> = [T][T extends any ? 0 : never]\n\nexport function useStore<\n TState,\n TSelected = NoInfer<TState>,\n TUpdater extends AnyUpdater = AnyUpdater,\n>(\n store: Store<TState, TUpdater>,\n selector: (state: NoInfer<TState>) => TSelected = (d) => d as any,\n): Accessor<TSelected> {\n const [slice, setSlice] = createStore({\n value: selector(store.state),\n })\n\n const unsub = store.subscribe(() => {\n const newValue = selector(store.state)\n setSlice('value', reconcile(newValue))\n })\n\n onCleanup(() => {\n unsub()\n })\n\n return () => slice.value\n}\n"],"names":["useStore","store","selector","d","slice","setSlice","createStore","value","state","unsub","subscribe","newValue","reconcile","onCleanup"],"mappings":";;;AASO,SAASA,SAKdC,OACAC,WAAmDC,CAAAA,MAAMA,GACpC;AACrB,QAAM,CAACC,OAAOC,QAAQ,IAAIC,YAAY;AAAA,IACpCC,OAAOL,SAASD,MAAMO,KAAK;AAAA,EAAA,CAC5B;AAEKC,QAAAA,QAAQR,MAAMS,UAAU,MAAM;AAC5BC,UAAAA,WAAWT,SAASD,MAAMO,KAAK;AAC5B,aAAA,SAASI,UAAUD,QAAQ,CAAC;AAAA,EAAA,CACtC;AAEDE,YAAU,MAAM;AACR,UAAA;AAAA,EAAA,CACP;AAED,SAAO,MAAMT,MAAMG;AACrB;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import { onCleanup } from 'solid-js'\nimport { createStore, reconcile } from 'solid-js/store'\nimport type { AnyUpdater, Store } from '@tanstack/store'\nimport type { Accessor } from 'solid-js'\n\nexport * from '@tanstack/store'\n\n/**\n * @private\n */\nexport type NoInfer<T> = [T][T extends any ? 0 : never]\n\nexport function useStore<\n TState,\n TSelected = NoInfer<TState>,\n TUpdater extends AnyUpdater = AnyUpdater,\n>(\n store: Store<TState, TUpdater>,\n selector: (state: NoInfer<TState>) => TSelected = (d) => d as any,\n): Accessor<TSelected> {\n const [slice, setSlice] = createStore({\n value: selector(store.state),\n })\n\n const unsub = store.subscribe(() => {\n const newValue = selector(store.state)\n setSlice('value', reconcile(newValue))\n })\n\n onCleanup(() => {\n unsub()\n })\n\n return () => slice.value\n}\n"],"names":["useStore","store","selector","d","slice","setSlice","createStore","value","state","unsub","subscribe","newValue","reconcile","onCleanup"],"mappings":";;;AAYO,SAASA,SAKdC,OACAC,WAAmDC,CAAAA,MAAMA,GACpC;AACrB,QAAM,CAACC,OAAOC,QAAQ,IAAIC,YAAY;AAAA,IACpCC,OAAOL,SAASD,MAAMO,KAAK;AAAA,EAAA,CAC5B;AAEKC,QAAAA,QAAQR,MAAMS,UAAU,MAAM;AAC5BC,UAAAA,WAAWT,SAASD,MAAMO,KAAK;AAC5B,aAAA,SAASI,UAAUD,QAAQ,CAAC;AAAA,EAAA,CACtC;AAEDE,YAAU,MAAM;AACR,UAAA;AAAA,EAAA,CACP;AAED,SAAO,MAAMT,MAAMG;AACrB;"}
@@ -1,5 +1,8 @@
1
1
  import type { AnyUpdater, Store } from '@tanstack/store';
2
2
  import type { Accessor } from 'solid-js';
3
3
  export * from '@tanstack/store';
4
+ /**
5
+ * @private
6
+ */
4
7
  export type NoInfer<T> = [T][T extends any ? 0 : never];
5
8
  export declare function useStore<TState, TSelected = NoInfer<TState>, TUpdater extends AnyUpdater = AnyUpdater>(store: Store<TState, TUpdater>, selector?: (state: NoInfer<TState>) => TSelected): Accessor<TSelected>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAIvD,cAAc,iBAAiB,CAAA;AAI/B,MAAM,UAAU,QAAQ,CAKtB,KAA8B,EAC9B,WAAkD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAQ;IAEjE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,WAAW,CAAC;QACpC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;KAC7B,CAAC,CAAA;IAEF,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjC,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACtC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAA;IACxC,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,EAAE,CAAA;IACT,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAA;AAC1B,CAAC"}
1
+ {"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAIvD,cAAc,iBAAiB,CAAA;AAO/B,MAAM,UAAU,QAAQ,CAKtB,KAA8B,EAC9B,WAAkD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAQ;IAEjE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,WAAW,CAAC;QACpC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;KAC7B,CAAC,CAAA;IAEF,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjC,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACtC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAA;IACxC,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,EAAE,CAAA;IACT,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAA;AAC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-store",
3
- "version": "0.5.7",
3
+ "version": "0.6.0",
4
4
  "description": "Framework agnostic type-safe store w/ reactive framework adapters",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "src"
47
47
  ],
48
48
  "dependencies": {
49
- "@tanstack/store": "0.5.5"
49
+ "@tanstack/store": "0.6.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "solid-js": "^1.9.3",
package/src/index.tsx CHANGED
@@ -5,6 +5,9 @@ import type { Accessor } from 'solid-js'
5
5
 
6
6
  export * from '@tanstack/store'
7
7
 
8
+ /**
9
+ * @private
10
+ */
8
11
  export type NoInfer<T> = [T][T extends any ? 0 : never]
9
12
 
10
13
  export function useStore<