@octanejs/tanstack-store 0.0.47 → 0.0.49
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/README.md +3 -3
- package/package.json +6 -6
- package/src/useSelector.ts +6 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ npm install @octanejs/tanstack-store
|
|
|
10
10
|
pnpm add @octanejs/tanstack-store
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
This package ports `@tanstack/react-store@0.11.
|
|
13
|
+
This package ports `@tanstack/react-store@0.11.1` by reusing the
|
|
14
14
|
framework-agnostic `@tanstack/store` core unchanged and transcribing its small
|
|
15
15
|
React hook layer onto Octane. The supported runtime and type surfaces match the
|
|
16
16
|
React package, so an application can migrate by changing its import:
|
|
@@ -43,9 +43,9 @@ export function Counter() @{
|
|
|
43
43
|
|
|
44
44
|
## API
|
|
45
45
|
|
|
46
|
-
The package re-exports all of `@tanstack/store@0.11.
|
|
46
|
+
The package re-exports all of `@tanstack/store@0.11.1`, including atoms,
|
|
47
47
|
stores, actions, derived sources, `shallow`, and async atoms. It also provides
|
|
48
|
-
the stable adapter surface from `@tanstack/react-store@0.11.
|
|
48
|
+
the stable adapter surface from `@tanstack/react-store@0.11.1`:
|
|
49
49
|
|
|
50
50
|
- `useSelector` reads any atom or store and supports a custom comparator.
|
|
51
51
|
- `useAtom` returns a writable atom's current value and setter.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/tanstack-store",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
".": "./src/index.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@tanstack/store": "0.11.
|
|
41
|
+
"@tanstack/store": "0.11.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"octane": "^0.1.51 || ^0.2.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@tanstack/react-store": "0.11.
|
|
47
|
+
"@tanstack/react-store": "0.11.1",
|
|
48
48
|
"@testing-library/jest-dom": "^6.9.1",
|
|
49
49
|
"@testing-library/react": "16.3.1",
|
|
50
50
|
"@testing-library/user-event": "^14.6.1",
|
|
51
|
-
"@tsrx/react": "^0.
|
|
51
|
+
"@tsrx/react": "^0.3.0",
|
|
52
52
|
"@types/react": "19.2.7",
|
|
53
53
|
"@types/react-dom": "19.2.3",
|
|
54
54
|
"@types/use-sync-external-store": "^1.5.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.
|
|
61
|
-
"octane": "0.2.
|
|
60
|
+
"@octanejs/testing-library": "0.1.51",
|
|
61
|
+
"octane": "0.2.16"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest run",
|
package/src/useSelector.ts
CHANGED
|
@@ -3,7 +3,12 @@ import { splitSlot, subSlot } from './internal';
|
|
|
3
3
|
import { useSyncExternalStoreWithSelector } from './useSyncExternalStoreWithSelector';
|
|
4
4
|
|
|
5
5
|
export interface UseSelectorOptions<TSelected> {
|
|
6
|
-
|
|
6
|
+
// Written as an optional property that also admits `undefined`, because this
|
|
7
|
+
// package publishes source and the consumer's compiler options apply to it.
|
|
8
|
+
// Under `exactOptionalPropertyTypes` a bare `compare?:` would reject both an
|
|
9
|
+
// options object forwarded from another optional value and this package's own
|
|
10
|
+
// `useStore` bridge, which always passes the key through.
|
|
11
|
+
compare?: ((a: TSelected, b: TSelected) => boolean) | undefined;
|
|
7
12
|
}
|
|
8
13
|
|
|
9
14
|
type SyncExternalStoreSubscribe = Parameters<typeof useSyncExternalStoreWithSelector>[0];
|