Skip to content

fix(core) derive auto mount #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/framework/angular/reference/functions/injectstore.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function injectStore<TState, TSelected>(
options?): Signal<TSelected>
```

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

### Type Parameters

Expand Down Expand Up @@ -51,7 +51,7 @@ function injectStore<TState, TSelected>(
options?): Signal<TSelected>
```

Defined in: [index.ts:24](https://github.com/TanStack/store/blob/main/packages/angular-store/src/index.ts#L24)
Defined in: [index.ts:24](https://github.com/I-am-abdulazeez/store/blob/main/packages/angular-store/src/index.ts#L24)

### Type Parameters

Expand Down
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 @@ -11,7 +11,7 @@ title: shallow
function shallow<T>(objA, objB): boolean
```

Defined in: [index.ts:34](https://github.com/TanStack/store/blob/main/packages/react-store/src/index.ts#L34)
Defined in: [index.ts:34](https://github.com/I-am-abdulazeez/store/blob/main/packages/react-store/src/index.ts#L34)

## Type Parameters

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/react/reference/functions/usestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ title: useStore
function useStore<TState, TSelected>(store, selector?): TSelected
```

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

### Type Parameters

Expand Down Expand Up @@ -41,7 +41,7 @@ Defined in: [index.ts:11](https://github.com/TanStack/store/blob/main/packages/r
function useStore<TState, TSelected>(store, selector?): TSelected
```

Defined in: [index.ts:15](https://github.com/TanStack/store/blob/main/packages/react-store/src/index.ts#L15)
Defined in: [index.ts:15](https://github.com/I-am-abdulazeez/store/blob/main/packages/react-store/src/index.ts#L15)

### Type Parameters

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/solid/reference/functions/usestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ title: useStore
function useStore<TState, TSelected>(store, selector?): Accessor<TSelected>
```

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

### Type Parameters

Expand Down Expand Up @@ -41,7 +41,7 @@ Defined in: [index.tsx:13](https://github.com/TanStack/store/blob/main/packages/
function useStore<TState, TSelected>(store, selector?): Accessor<TSelected>
```

Defined in: [index.tsx:17](https://github.com/TanStack/store/blob/main/packages/solid-store/src/index.tsx#L17)
Defined in: [index.tsx:17](https://github.com/I-am-abdulazeez/store/blob/main/packages/solid-store/src/index.tsx#L17)

### Type Parameters

Expand Down
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 @@ -11,7 +11,7 @@ title: shallow
function shallow<T>(objA, objB): boolean
```

Defined in: [index.svelte.ts:43](https://github.com/TanStack/store/blob/main/packages/svelte-store/src/index.svelte.ts#L43)
Defined in: [index.svelte.ts:43](https://github.com/I-am-abdulazeez/store/blob/main/packages/svelte-store/src/index.svelte.ts#L43)

## Type Parameters

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/svelte/reference/functions/usestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ title: useStore
function useStore<TState, TSelected>(store, selector?): object
```

Defined in: [index.svelte.ts:10](https://github.com/TanStack/store/blob/main/packages/svelte-store/src/index.svelte.ts#L10)
Defined in: [index.svelte.ts:10](https://github.com/I-am-abdulazeez/store/blob/main/packages/svelte-store/src/index.svelte.ts#L10)

### Type Parameters

Expand Down Expand Up @@ -47,7 +47,7 @@ readonly current: TSelected;
function useStore<TState, TSelected>(store, selector?): object
```

Defined in: [index.svelte.ts:14](https://github.com/TanStack/store/blob/main/packages/svelte-store/src/index.svelte.ts#L14)
Defined in: [index.svelte.ts:14](https://github.com/I-am-abdulazeez/store/blob/main/packages/svelte-store/src/index.svelte.ts#L14)

### Type Parameters

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

Defined in: [index.ts:47](https://github.com/TanStack/store/blob/main/packages/vue-store/src/index.ts#L47)
Defined in: [index.ts:47](https://github.com/I-am-abdulazeez/store/blob/main/packages/vue-store/src/index.ts#L47)

## Type Parameters

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/vue/reference/functions/usestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ title: useStore
function useStore<TState, TSelected>(store, selector?): Readonly<Ref<TSelected, TSelected>>
```

Defined in: [index.ts:12](https://github.com/TanStack/store/blob/main/packages/vue-store/src/index.ts#L12)
Defined in: [index.ts:12](https://github.com/I-am-abdulazeez/store/blob/main/packages/vue-store/src/index.ts#L12)

### Type Parameters

Expand Down Expand Up @@ -41,7 +41,7 @@ Defined in: [index.ts:12](https://github.com/TanStack/store/blob/main/packages/v
function useStore<TState, TSelected>(store, selector?): Readonly<Ref<TSelected, TSelected>>
```

Defined in: [index.ts:16](https://github.com/TanStack/store/blob/main/packages/vue-store/src/index.ts#L16)
Defined in: [index.ts:16](https://github.com/I-am-abdulazeez/store/blob/main/packages/vue-store/src/index.ts#L16)

### Type Parameters

Expand Down
34 changes: 19 additions & 15 deletions docs/reference/classes/derived.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Derived

# Class: Derived\<TState, TArr\>

Defined in: [derived.ts:54](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L54)
Defined in: [derived.ts:54](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L54)

## Type Parameters

Expand All @@ -23,7 +23,7 @@ Defined in: [derived.ts:54](https://github.com/TanStack/store/blob/main/packages
new Derived<TState, TArr>(options): Derived<TState, TArr>
```

Defined in: [derived.ts:87](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L87)
Defined in: [derived.ts:92](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L92)

#### Parameters

Expand All @@ -43,7 +43,7 @@ Defined in: [derived.ts:87](https://github.com/TanStack/store/blob/main/packages
lastSeenDepValues: unknown[] = [];
```

Defined in: [derived.ts:71](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L71)
Defined in: [derived.ts:71](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L71)

***

Expand All @@ -53,7 +53,7 @@ Defined in: [derived.ts:71](https://github.com/TanStack/store/blob/main/packages
listeners: Set<Listener<TState>>;
```

Defined in: [derived.ts:60](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L60)
Defined in: [derived.ts:60](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L60)

***

Expand All @@ -63,7 +63,7 @@ Defined in: [derived.ts:60](https://github.com/TanStack/store/blob/main/packages
options: DerivedOptions<TState, TArr>;
```

Defined in: [derived.ts:63](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L63)
Defined in: [derived.ts:63](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L63)

***

Expand All @@ -73,7 +73,7 @@ Defined in: [derived.ts:63](https://github.com/TanStack/store/blob/main/packages
prevState: undefined | TState;
```

Defined in: [derived.ts:62](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L62)
Defined in: [derived.ts:62](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L62)

***

Expand All @@ -83,7 +83,7 @@ Defined in: [derived.ts:62](https://github.com/TanStack/store/blob/main/packages
state: TState;
```

Defined in: [derived.ts:61](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L61)
Defined in: [derived.ts:61](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L61)

## Methods

Expand All @@ -93,7 +93,7 @@ Defined in: [derived.ts:61](https://github.com/TanStack/store/blob/main/packages
checkIfRecalculationNeededDeeply(): void
```

Defined in: [derived.ts:157](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L157)
Defined in: [derived.ts:164](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L164)

#### Returns

Expand All @@ -107,7 +107,7 @@ Defined in: [derived.ts:157](https://github.com/TanStack/store/blob/main/package
getDepVals(): object
```

Defined in: [derived.ts:72](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L72)
Defined in: [derived.ts:77](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L77)

#### Returns

Expand All @@ -133,13 +133,13 @@ prevVal: undefined | NonNullable<TState>;

***

### mount()
### ~~mount()~~

```ts
mount(): () => void
```

Defined in: [derived.ts:178](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L178)
Defined in: [derived.ts:188](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L188)

#### Returns

Expand All @@ -149,6 +149,10 @@ Defined in: [derived.ts:178](https://github.com/TanStack/store/blob/main/package

`void`

#### Deprecated

Use subscribe() instead, which automatically mounts when needed

***

### recompute()
Expand All @@ -157,7 +161,7 @@ Defined in: [derived.ts:178](https://github.com/TanStack/store/blob/main/package
recompute(): void
```

Defined in: [derived.ts:145](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L145)
Defined in: [derived.ts:152](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L152)

#### Returns

Expand All @@ -171,7 +175,7 @@ Defined in: [derived.ts:145](https://github.com/TanStack/store/blob/main/package
registerOnGraph(deps): void
```

Defined in: [derived.ts:96](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L96)
Defined in: [derived.ts:103](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L103)

#### Parameters

Expand All @@ -193,7 +197,7 @@ readonly (
subscribe(listener): () => void
```

Defined in: [derived.ts:190](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L190)
Defined in: [derived.ts:195](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L195)

#### Parameters

Expand All @@ -217,7 +221,7 @@ Defined in: [derived.ts:190](https://github.com/TanStack/store/blob/main/package
unregisterFromGraph(deps): void
```

Defined in: [derived.ts:125](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L125)
Defined in: [derived.ts:132](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/derived.ts#L132)

#### Parameters

Expand Down
6 changes: 3 additions & 3 deletions docs/reference/classes/effect.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Effect

# Class: Effect

Defined in: [effect.ts:17](https://github.com/TanStack/store/blob/main/packages/store/src/effect.ts#L17)
Defined in: [effect.ts:17](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/effect.ts#L17)

## Constructors

Expand All @@ -17,7 +17,7 @@ Defined in: [effect.ts:17](https://github.com/TanStack/store/blob/main/packages/
new Effect(opts): Effect
```

Defined in: [effect.ts:23](https://github.com/TanStack/store/blob/main/packages/store/src/effect.ts#L23)
Defined in: [effect.ts:23](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/effect.ts#L23)

#### Parameters

Expand All @@ -37,7 +37,7 @@ Defined in: [effect.ts:23](https://github.com/TanStack/store/blob/main/packages/
mount(): () => void
```

Defined in: [effect.ts:39](https://github.com/TanStack/store/blob/main/packages/store/src/effect.ts#L39)
Defined in: [effect.ts:39](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/effect.ts#L39)

#### Returns

Expand Down
16 changes: 8 additions & 8 deletions docs/reference/classes/store.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Store

# Class: Store\<TState, TUpdater\>

Defined in: [store.ts:27](https://github.com/TanStack/store/blob/main/packages/store/src/store.ts#L27)
Defined in: [store.ts:27](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/store.ts#L27)

## Type Parameters

Expand All @@ -23,7 +23,7 @@ Defined in: [store.ts:27](https://github.com/TanStack/store/blob/main/packages/s
new Store<TState, TUpdater>(initialState, options?): Store<TState, TUpdater>
```

Defined in: [store.ts:36](https://github.com/TanStack/store/blob/main/packages/store/src/store.ts#L36)
Defined in: [store.ts:36](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/store.ts#L36)

#### Parameters

Expand All @@ -47,7 +47,7 @@ Defined in: [store.ts:36](https://github.com/TanStack/store/blob/main/packages/s
listeners: Set<Listener<TState>>;
```

Defined in: [store.ts:31](https://github.com/TanStack/store/blob/main/packages/store/src/store.ts#L31)
Defined in: [store.ts:31](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/store.ts#L31)

***

Expand All @@ -57,7 +57,7 @@ Defined in: [store.ts:31](https://github.com/TanStack/store/blob/main/packages/s
optional options: StoreOptions<TState, TUpdater>;
```

Defined in: [store.ts:34](https://github.com/TanStack/store/blob/main/packages/store/src/store.ts#L34)
Defined in: [store.ts:34](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/store.ts#L34)

***

Expand All @@ -67,7 +67,7 @@ Defined in: [store.ts:34](https://github.com/TanStack/store/blob/main/packages/s
prevState: TState;
```

Defined in: [store.ts:33](https://github.com/TanStack/store/blob/main/packages/store/src/store.ts#L33)
Defined in: [store.ts:33](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/store.ts#L33)

***

Expand All @@ -77,7 +77,7 @@ Defined in: [store.ts:33](https://github.com/TanStack/store/blob/main/packages/s
state: TState;
```

Defined in: [store.ts:32](https://github.com/TanStack/store/blob/main/packages/store/src/store.ts#L32)
Defined in: [store.ts:32](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/store.ts#L32)

## Methods

Expand All @@ -87,7 +87,7 @@ Defined in: [store.ts:32](https://github.com/TanStack/store/blob/main/packages/s
setState(updater): void
```

Defined in: [store.ts:51](https://github.com/TanStack/store/blob/main/packages/store/src/store.ts#L51)
Defined in: [store.ts:51](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/store.ts#L51)

#### Parameters

Expand All @@ -107,7 +107,7 @@ Defined in: [store.ts:51](https://github.com/TanStack/store/blob/main/packages/s
subscribe(listener): () => void
```

Defined in: [store.ts:42](https://github.com/TanStack/store/blob/main/packages/store/src/store.ts#L42)
Defined in: [store.ts:42](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/store.ts#L42)

#### Parameters

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/functions/batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: batch
function batch(fn): void
```

Defined in: [scheduler.ts:140](https://github.com/TanStack/store/blob/main/packages/store/src/scheduler.ts#L140)
Defined in: [scheduler.ts:140](https://github.com/I-am-abdulazeez/store/blob/main/packages/store/src/scheduler.ts#L140)

## Parameters

Expand Down
Loading