@tanstack/solid-store
Advanced tools
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["import type { AnyUpdater, Store } from '@tanstack/store'\nimport type { Accessor } from 'solid-js'\nimport { onCleanup } from 'solid-js'\nimport { createStore, reconcile } from 'solid-js/store'\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":["store","createStore","reconcile","onCleanup"],"mappings":";;;;;AASO,SAAS,SAKdA,QACA,WAAkD,CAAC,MAAM,GACpC;AACrB,QAAM,CAAC,OAAO,QAAQ,IAAIC,oBAAY;AAAA,IACpC,OAAO,SAASD,OAAM,KAAK;AAAA,EAAA,CAC5B;AAEK,QAAA,QAAQA,OAAM,UAAU,MAAM;AAC5B,UAAA,WAAW,SAASA,OAAM,KAAK;AAC5B,aAAA,SAASE,kBAAU,QAAQ,CAAC;AAAA,EAAA,CACtC;AAEDC,UAAAA,UAAU,MAAM;AACR;EAAA,CACP;AAED,SAAO,MAAM,MAAM;AACrB;;;;;;;;;"} | ||
| {"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"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":["store","createStore","reconcile","onCleanup"],"mappings":";;;;;AASO,SAAS,SAKdA,QACA,WAAkD,CAAC,MAAM,GACpC;AACrB,QAAM,CAAC,OAAO,QAAQ,IAAIC,oBAAY;AAAA,IACpC,OAAO,SAASD,OAAM,KAAK;AAAA,EAAA,CAC5B;AAEK,QAAA,QAAQA,OAAM,UAAU,MAAM;AAC5B,UAAA,WAAW,SAASA,OAAM,KAAK;AAC5B,aAAA,SAASE,kBAAU,QAAQ,CAAC;AAAA,EAAA,CACtC;AAEDC,UAAAA,UAAU,MAAM;AACR;EAAA,CACP;AAED,SAAO,MAAM,MAAM;AACrB;;;;;;;;;"} |
@@ -1,5 +0,6 @@ | ||
| import type { AnyUpdater, Store } from '@tanstack/store'; | ||
| import type { Accessor } from 'solid-js'; | ||
| import { AnyUpdater, Store } from '@tanstack/store'; | ||
| import { Accessor } from 'solid-js'; | ||
| export * from '@tanstack/store'; | ||
| export type NoInfer<T> = [T][T extends any ? 0 : never]; | ||
| 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 +0,6 @@ | ||
| import type { AnyUpdater, Store } from '@tanstack/store'; | ||
| import type { Accessor } from 'solid-js'; | ||
| import { AnyUpdater, Store } from '@tanstack/store'; | ||
| import { Accessor } from 'solid-js'; | ||
| export * from '@tanstack/store'; | ||
| export type NoInfer<T> = [T][T extends any ? 0 : never]; | ||
| 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 +0,1 @@ | ||
| {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import type { AnyUpdater, Store } from '@tanstack/store'\nimport type { Accessor } from 'solid-js'\nimport { onCleanup } from 'solid-js'\nimport { createStore, reconcile } from 'solid-js/store'\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":[],"mappings":";;;AASO,SAAS,SAKd,OACA,WAAkD,CAAC,MAAM,GACpC;AACrB,QAAM,CAAC,OAAO,QAAQ,IAAI,YAAY;AAAA,IACpC,OAAO,SAAS,MAAM,KAAK;AAAA,EAAA,CAC5B;AAEK,QAAA,QAAQ,MAAM,UAAU,MAAM;AAC5B,UAAA,WAAW,SAAS,MAAM,KAAK;AAC5B,aAAA,SAAS,UAAU,QAAQ,CAAC;AAAA,EAAA,CACtC;AAED,YAAU,MAAM;AACR;EAAA,CACP;AAED,SAAO,MAAM,MAAM;AACrB;"} | ||
| {"version":3,"file":"index.js","sources":["../../src/index.ts"],"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":[],"mappings":";;;AASO,SAAS,SAKd,OACA,WAAkD,CAAC,MAAM,GACpC;AACrB,QAAM,CAAC,OAAO,QAAQ,IAAI,YAAY;AAAA,IACpC,OAAO,SAAS,MAAM,KAAK;AAAA,EAAA,CAC5B;AAEK,QAAA,QAAQ,MAAM,UAAU,MAAM;AAC5B,UAAA,WAAW,SAAS,MAAM,KAAK;AAC5B,aAAA,SAAS,UAAU,QAAQ,CAAC;AAAA,EAAA,CACtC;AAED,YAAU,MAAM;AACR;EAAA,CACP;AAED,SAAO,MAAM,MAAM;AACrB;"} |
+5
-17
| { | ||
| "name": "@tanstack/solid-store", | ||
| "author": "Tanner Linsley", | ||
| "version": "0.3.1", | ||
| "version": "0.4.1", | ||
| "license": "MIT", | ||
| "repository": "tanstack/solid-store", | ||
| "repository": "tanstack/store", | ||
| "homepage": "https://tanstack.com/", | ||
@@ -47,21 +47,9 @@ "description": "", | ||
| "dependencies": { | ||
| "@tanstack/store": "0.3.1" | ||
| "@tanstack/store": "0.4.1" | ||
| }, | ||
| "devDependencies": { | ||
| "solid-js": "^1.7.8", | ||
| "vite-plugin-solid": "^2.8.0" | ||
| "vite-plugin-solid": "^2.10.1" | ||
| }, | ||
| "scripts": { | ||
| "clean": "rimraf ./dist && rimraf ./coverage", | ||
| "test:eslint": "eslint --ext .ts,.tsx ./src", | ||
| "test:types:versions49": "node ../../node_modules/typescript49/lib/tsc.js --project tsconfig.legacy.json", | ||
| "test:types:versions50": "node ../../node_modules/typescript50/lib/tsc.js", | ||
| "test:types:versions51": "node ../../node_modules/typescript51/lib/tsc.js", | ||
| "test:types:versions52": "tsc", | ||
| "test:types": "pnpm run \"/^test:types:versions.*/\"", | ||
| "test:lib": "vitest", | ||
| "test:lib:dev": "pnpm run test:lib --watch", | ||
| "test:build": "publint --strict", | ||
| "build": "vite build" | ||
| } | ||
| "scripts": {} | ||
| } |
+2
-2
@@ -0,5 +1,5 @@ | ||
| import { onCleanup } from 'solid-js' | ||
| import { createStore, reconcile } from 'solid-js/store' | ||
| import type { AnyUpdater, Store } from '@tanstack/store' | ||
| import type { Accessor } from 'solid-js' | ||
| import { onCleanup } from 'solid-js' | ||
| import { createStore, reconcile } from 'solid-js/store' | ||
@@ -6,0 +6,0 @@ export * from '@tanstack/store' |
@@ -0,3 +1,3 @@ | ||
| import { describe, expect, it } from 'vitest' | ||
| import { render, renderHook } from '@solidjs/testing-library' | ||
| import '@testing-library/jest-dom' | ||
| import { Store } from '@tanstack/store' | ||
@@ -4,0 +4,0 @@ import { useStore } from '../index' |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
8809
-6.59%+ Added
- Removed
Updated