Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
d3be221
feat!: initial work on adding derived signals
crutchcorn Feb 5, 2024
5830fca
chore: add tests to derived state
crutchcorn Feb 5, 2024
ae74fa5
fix: add cleanup edgecase
crutchcorn Feb 5, 2024
605b520
fix: edgecase where using derived and store for base
crutchcorn Feb 5, 2024
9d4deb7
docs: update docs link
crutchcorn Feb 6, 2024
12d40a6
chore: refactor derived class
crutchcorn Feb 6, 2024
368db9d
chore: further refactors
crutchcorn Feb 6, 2024
759040d
chore: refactor work to make things a bit cleaner
crutchcorn Feb 6, 2024
d79b473
chore: minor renaming and cleanup
crutchcorn Feb 7, 2024
5700cc3
chore: add initial benchmarks
crutchcorn Feb 7, 2024
0f7c648
chore: add Angular
crutchcorn Feb 7, 2024
f0ec935
chore: update benchmark package versions
crutchcorn Feb 7, 2024
790303c
chore: fix ci
crutchcorn Feb 7, 2024
5a069c7
chore: move to proper derived store
crutchcorn Feb 9, 2024
157413f
fix: avoid issues with what signal is being written
crutchcorn Feb 9, 2024
192829c
chore: ignore benchmark file in test coverage
crutchcorn Feb 9, 2024
f4dc9da
chore: rename TSX to TS
crutchcorn Feb 9, 2024
b7987e8
feat: add Effect
crutchcorn Feb 9, 2024
aa447aa
Merge branch 'main' into derived-diamond-problem
lachlancollins Feb 17, 2024
87dd588
Fix eslint, sherif, and knip
lachlancollins Feb 17, 2024
de55814
chore: migrate from forEach to for of loop
crutchcorn Feb 26, 2024
2bb46e3
Merge branch 'main' into derived-diamond-problem
crutchcorn Aug 12, 2024
fa65a7e
ci: apply automated fixes
autofix-ci[bot] Aug 12, 2024
357a301
improve Vue performance (#122)
ZainW Sep 29, 2024
228db0e
feat: add lazyness to derived (#109)
crutchcorn Nov 25, 2024
925ecae
Merge branch 'main' into derived-diamond-problem
crutchcorn Nov 25, 2024
81ef72c
chore: migrate to options object over positional arguments
crutchcorn Nov 25, 2024
eac78fa
ci: apply automated fixes
autofix-ci[bot] Nov 25, 2024
a7e9cbe
chore: fix sherif
crutchcorn Nov 25, 2024
62c3664
Merge branch 'main' into derived-diamond-problem
crutchcorn Nov 25, 2024
bd900f7
docs: add autogenerated docs for effect and derived
crutchcorn Nov 25, 2024
3db6e6f
Merge branch 'main' into derived-diamond-problem
crutchcorn Nov 25, 2024
49e47ea
Merge branch 'main' into derived-diamond-problem
crutchcorn Nov 25, 2024
8105722
Merge branch 'main' into derived-diamond-problem
crutchcorn Nov 25, 2024
b952bce
chore: migrate derived and effect to have cleanup and mount as distin…
crutchcorn Nov 25, 2024
9958187
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 25, 2024
b53b821
feat: add previous and current value to the store
crutchcorn Nov 25, 2024
a46d778
feat: add ability to track previous and new values of deps
crutchcorn Nov 25, 2024
cd7bb0d
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 25, 2024
0fe4628
chore: fix build
crutchcorn Nov 25, 2024
cc48436
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 25, 2024
709f04b
feat: add ability to get previous value from derived fn
crutchcorn Nov 27, 2024
f8c9839
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 27, 2024
c3b3f94
feat: add proper typings to derived state
crutchcorn Nov 27, 2024
cef42eb
Merge branch 'derived-diamond-problem' of https://github.com/TanStack…
crutchcorn Nov 27, 2024
24a771b
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 27, 2024
ec4fcc1
chore: fix potentially faulty TState inferencing
crutchcorn Nov 27, 2024
555b7bb
Merge branch 'derived-diamond-problem' of https://github.com/TanStack…
crutchcorn Nov 27, 2024
15ce0d4
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 27, 2024
b1fa3ad
chore: fix usage for TypeScript 4.9
crutchcorn Nov 29, 2024
ab0889d
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 29, 2024
4be2a82
chore: fix knip
crutchcorn Nov 29, 2024
e96a781
Merge branch 'derived-diamond-problem' of https://github.com/TanStack…
crutchcorn Nov 29, 2024
bf39f70
chore: more work to support TS5
crutchcorn Nov 29, 2024
1e7fec0
chore: fix usage of import and require type
crutchcorn Nov 29, 2024
df0646d
chore!: drop TypeScript 4.9 support
crutchcorn Nov 29, 2024
7b0bdd2
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 29, 2024
d751b2d
fix: prevState now works as intended
crutchcorn Nov 29, 2024
e8ff103
chore!: remove store.batch, add in temporary scheduler, skip intentio…
crutchcorn Nov 29, 2024
5f11306
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 29, 2024
8fb38a8
chore: add working unregister from graph
crutchcorn Nov 29, 2024
ee55538
chore: hooman attempt
crutchcorn Nov 29, 2024
0be5257
chore: cursor attempt
crutchcorn Nov 29, 2024
7a41b27
chore: code cleanup and add back batch tests
crutchcorn Nov 29, 2024
dbbf664
chore: fix listener recieving old values
crutchcorn Nov 29, 2024
2b95688
chore: fix laziness
crutchcorn Nov 29, 2024
9661c17
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 29, 2024
acf03d7
chore!: fix timings and temporarily(?) remove lazy prop
crutchcorn Nov 30, 2024
7e9752f
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 30, 2024
13c472f
chore: migrate useStore in React to support Derived values stores as …
crutchcorn Nov 30, 2024
8c0e587
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 30, 2024
782e772
chore: fix CI tests
crutchcorn Nov 30, 2024
5d2e67f
chore: add Angular store Derived support
crutchcorn Nov 30, 2024
6e5156d
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 30, 2024
2baec1f
chore: fix issues with Solid store tests
crutchcorn Nov 30, 2024
ac58a5f
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 30, 2024
2c4129f
chore: fix useStore from Vue
crutchcorn Nov 30, 2024
861e8df
Merge branch 'derived-diamond-problem' of https://github.com/TanStack…
crutchcorn Nov 30, 2024
59ab2df
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 30, 2024
9a5d485
chore: svelte works with useStore now
crutchcorn Nov 30, 2024
697d15e
Merge branch 'derived-diamond-problem' of https://github.com/TanStack…
crutchcorn Nov 30, 2024
46e63ef
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 30, 2024
7dc64d5
chore: add demo of useStore working as-intended
crutchcorn Nov 30, 2024
34ae6b0
Merge branch 'derived-diamond-problem' of https://github.com/TanStack…
crutchcorn Nov 30, 2024
f8c01f6
chore: fix CI
crutchcorn Nov 30, 2024
e9c449d
fix: issues with unmounting and remounting derived values
crutchcorn Dec 1, 2024
ab4c1f3
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 1, 2024
2e0bfd3
chore: add failing tests
crutchcorn Dec 1, 2024
634cbf2
fix: issues with out-of-order mounting should be fixed
crutchcorn Dec 1, 2024
e16ced5
Merge branch 'derived-diamond-problem' of https://github.com/TanStack…
crutchcorn Dec 1, 2024
4ec258b
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 1, 2024
ce6f794
chore: add tests
crutchcorn Dec 1, 2024
38558db
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 1, 2024
29af493
chore: add another failing test
crutchcorn Dec 1, 2024
cc45169
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 1, 2024
7250813
chore: initial work to refactor away from Derived having an internal …
crutchcorn Dec 2, 2024
40dd505
chore: test refactor of Derived to not include a Store
crutchcorn Dec 2, 2024
5b2d4cd
fix: issues with recomputing should now be resolved
crutchcorn Dec 2, 2024
c8829b9
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 2, 2024
45abb51
chore: add failing test
crutchcorn Dec 2, 2024
cad759a
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 2, 2024
01a1422
fix: add fix to broken test
crutchcorn Dec 2, 2024
e6cdf83
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 2, 2024
54d221a
fix: batched values do not break prevDepVals and currDepVals anymore
crutchcorn Dec 26, 2024
51140c9
Merge branch 'main' into derived-diamond-problem
crutchcorn Dec 26, 2024
aa393a5
chore: fix CI
crutchcorn Dec 26, 2024
1aab40c
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 26, 2024
6099591
docs: finish vanilla JS quick-start guide
crutchcorn Dec 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
{
"label": "Installation",
"to": "installation"
},
{
"label": "Quick Start",
"to": "quick-start"
}
],
"frameworks": [
Expand Down Expand Up @@ -77,9 +81,21 @@
"label": "Classes / Store",
"to": "reference/classes/store"
},
{
"label": "Classes / Derived",
"to": "reference/classes/derived"
},
{
"label": "Classes / Effect",
"to": "reference/classes/effect"
},
{
"label": "Interfaces / StoreOptions",
"to": "reference/interfaces/storeoptions"
},
{
"label": "Interfaces / DerivedOptions",
"to": "reference/interfaces/derivedoptions"
}
],
"frameworks": [
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/angular/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Quick Start
id: quick-start
---

The basic angular app example to get started with the Tanstack angular-store.
The basic angular app example to get started with the TanStack angular-store.

**app.component.ts**
```angular-ts
Expand Down
65 changes: 51 additions & 14 deletions docs/framework/angular/reference/functions/injectstore.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,76 @@ title: injectStore

# Function: injectStore()

## Call Signature

```ts
function injectStore<TState, TSelected, TUpdater>(
function injectStore<TState, TSelected>(
store,
selector,
options): Signal<TSelected>
selector?,
options?): Signal<TSelected>
```

## Type Parameters
### Type Parameters

• **TState**

• **TSelected** = `NoInfer`\<`TState`\>

• **TUpdater** *extends* `AnyUpdater` = `AnyUpdater`
### Parameters

#### store

`Store`\<`TState`, `any`\>

#### selector?

(`state`) => `TSelected`

#### options?

`CreateSignalOptions`\<`TSelected`\> & `object`

### Returns

`Signal`\<`TSelected`\>

### Defined in

[index.ts:19](https://github.com/TanStack/store/blob/main/packages/angular-store/src/index.ts#L19)

## Call Signature

```ts
function injectStore<TState, TSelected>(
store,
selector?,
options?): Signal<TSelected>
```

### Type Parameters

• **TState**

• **TSelected** = `NoInfer`\<`TState`\>

## Parameters
### Parameters

### store
#### store

`Store`\<`TState`, `TUpdater`\>
`Derived`\<`TState`, `any`\>

### selector
#### selector?

(`state`) => `TSelected`

### options
#### options?

`CreateSignalOptions`\<`TSelected`\> & `object` = `...`
`CreateSignalOptions`\<`TSelected`\> & `object`

## Returns
### Returns

`Signal`\<`TSelected`\>

## Defined in
### Defined in

[index.ts:17](https://github.com/TanStack/store/blob/main/packages/angular-store/src/index.ts#L17)
[index.ts:24](https://github.com/TanStack/store/blob/main/packages/angular-store/src/index.ts#L24)
4 changes: 2 additions & 2 deletions docs/framework/react/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Quick Start
id: quick-start
---

The basic react app example to get started with the Tanstack react-store.
The basic react app example to get started with the TanStack react-store.

```tsx
import React from "react";
Expand Down Expand Up @@ -56,4 +56,4 @@ const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<App />);


```
```
2 changes: 1 addition & 1 deletion docs/framework/react/reference/functions/shallow.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ function shallow<T>(objA, objB): boolean

## Defined in

[index.ts:30](https://github.com/TanStack/store/blob/main/packages/react-store/src/index.ts#L30)
[index.ts:34](https://github.com/TanStack/store/blob/main/packages/react-store/src/index.ts#L34)
50 changes: 40 additions & 10 deletions docs/framework/react/reference/functions/usestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,62 @@ title: useStore

# Function: useStore()

## Call Signature

```ts
function useStore<TState, TSelected, TUpdater>(store, selector): TSelected
function useStore<TState, TSelected>(store, selector?): TSelected
```

## Type Parameters
### Type Parameters

• **TState**

• **TSelected** = `NoInfer`\<`TState`\>

• **TUpdater** *extends* `AnyUpdater` = `AnyUpdater`

## Parameters
### Parameters

### store
#### store

`Store`\<`TState`, `TUpdater`\>
`Store`\<`TState`, `any`\>

### selector
#### selector?

(`state`) => `TSelected`

## Returns
### Returns

`TSelected`

## Defined in
### Defined in

[index.ts:11](https://github.com/TanStack/store/blob/main/packages/react-store/src/index.ts#L11)

## Call Signature

```ts
function useStore<TState, TSelected>(store, selector?): TSelected
```

### Type Parameters

• **TState**

• **TSelected** = `NoInfer`\<`TState`\>

### Parameters

#### store

`Derived`\<`TState`, `any`\>

#### selector?

(`state`) => `TSelected`

### Returns

`TSelected`

### Defined in

[index.ts:15](https://github.com/TanStack/store/blob/main/packages/react-store/src/index.ts#L15)
2 changes: 1 addition & 1 deletion docs/framework/solid/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Quick Start
id: quick-start
---

The basic Solid app example to get started with the Tanstack Solid-store.
The basic Solid app example to get started with the TanStack Solid-store.

```jsx
import { useStore, Store } from '@tanstack/solid-store';
Expand Down
50 changes: 40 additions & 10 deletions docs/framework/solid/reference/functions/usestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,62 @@ title: useStore

# Function: useStore()

## Call Signature

```ts
function useStore<TState, TSelected, TUpdater>(store, selector): Accessor<TSelected>
function useStore<TState, TSelected>(store, selector?): Accessor<TSelected>
```

## Type Parameters
### Type Parameters

• **TState**

• **TSelected** = `NoInfer`\<`TState`\>

• **TUpdater** *extends* `AnyUpdater` = `AnyUpdater`

## Parameters
### Parameters

### store
#### store

`Store`\<`TState`, `TUpdater`\>
`Store`\<`TState`, `any`\>

### selector
#### selector?

(`state`) => `TSelected`

## Returns
### Returns

`Accessor`\<`TSelected`\>

## Defined in
### Defined in

[index.tsx:13](https://github.com/TanStack/store/blob/main/packages/solid-store/src/index.tsx#L13)

## Call Signature

```ts
function useStore<TState, TSelected>(store, selector?): Accessor<TSelected>
```

### Type Parameters

• **TState**

• **TSelected** = `NoInfer`\<`TState`\>

### Parameters

#### store

`Derived`\<`TState`, `any`\>

#### selector?

(`state`) => `TSelected`

### Returns

`Accessor`\<`TSelected`\>

### Defined in

[index.tsx:17](https://github.com/TanStack/store/blob/main/packages/solid-store/src/index.tsx#L17)
4 changes: 2 additions & 2 deletions docs/framework/svelte/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Quick Start
id: quick-start
---

The basic Svelte app example to get started with the Tanstack svelte-store.
The basic Svelte app example to get started with the TanStack svelte-store.

**store.ts**
```ts
Expand Down Expand Up @@ -65,4 +65,4 @@ export function updateState(animal: 'cats' | 'dogs') {
</script>

<button onclick={() => updateState(animal)}>My Friend Likes { animal }</button>
```
```
2 changes: 1 addition & 1 deletion docs/framework/svelte/reference/functions/shallow.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ function shallow<T>(objA, objB): boolean

## Defined in

[index.svelte.ts:39](https://github.com/TanStack/store/blob/main/packages/svelte-store/src/index.svelte.ts#L39)
[index.svelte.ts:43](https://github.com/TanStack/store/blob/main/packages/svelte-store/src/index.svelte.ts#L43)
Loading