Skip to content

Commit

Permalink
ci: apply automated fixes and generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Nov 27, 2024
1 parent cef42eb commit 24a771b
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 37 deletions.
56 changes: 38 additions & 18 deletions docs/reference/classes/derived.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,64 @@ id: Derived
title: Derived
---

# Class: Derived\<TState\>
# Class: Derived\<TState, TArr\>

## Type Parameters

**TState**

**TArr** *extends* `ReadonlyArray`\<[`Derived`](derived.md)\<`any`\> \| [`Store`](store.md)\<`any`\>\> = `ReadonlyArray`\<`any`\>

## Constructors

### new Derived()

```ts
new Derived<TState>(options): Derived<TState>
new Derived<TState, TArr>(options): Derived<TState, TArr>
```

#### Parameters

**options**: [`DerivedOptions`](../interfaces/derivedoptions.md)\<`TState`\>
**options**: [`DerivedOptions`](../interfaces/derivedoptions.md)\<`TState`, `TArr`\>

#### Returns

[`Derived`](derived.md)\<`TState`\>
[`Derived`](derived.md)\<`TState`, `TArr`\>

#### Defined in

[derived.ts:87](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L87)
[derived.ts:115](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L115)

## Properties

### derivedToStore

```ts
derivedToStore: Map<Derived<unknown>, Set<Store<unknown, (cb) => unknown>>>;
derivedToStore: Map<Derived<unknown, readonly any[]>, Set<Store<unknown, (cb) => unknown>>>;
```

#### Defined in

[derived.ts:71](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L71)
[derived.ts:99](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L99)

***

### options

```ts
options: DerivedOptions<TState>;
options: DerivedOptions<TState, TArr>;
```

#### Defined in

[derived.ts:41](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L41)
[derived.ts:69](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L69)

***

### storeToDerived

```ts
storeToDerived: Map<Store<unknown, (cb) => unknown>, Set<Derived<unknown>>>;
storeToDerived: Map<Store<unknown, (cb) => unknown>, Set<Derived<unknown, readonly any[]>>>;
```

This is here to solve the pyramid dependency problem where:
Expand All @@ -77,7 +79,7 @@ This is a record of stores, because derived stores are not able to write values

#### Defined in

[derived.ts:70](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L70)
[derived.ts:98](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L98)

## Accessors

Expand All @@ -95,7 +97,7 @@ get prevState(): TState

#### Defined in

[derived.ts:133](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L133)
[derived.ts:161](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L161)

***

Expand All @@ -113,23 +115,41 @@ get state(): TState

#### Defined in

[derived.ts:124](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L124)
[derived.ts:152](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L152)

## Methods

### getDepVals()

```ts
getDepVals(): DerivedFnProps<TState>
getDepVals(): object
```

#### Returns

[`DerivedFnProps`](../interfaces/derivedfnprops.md)\<`TState`\>
`object`

##### currDepVals

```ts
currDepVals: never;
```

##### prevDepVals

```ts
prevDepVals: never;
```

##### prevVal

```ts
prevVal: undefined | NonNullable<TState>;
```

#### Defined in

[derived.ts:73](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L73)
[derived.ts:101](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L101)

***

Expand All @@ -149,7 +169,7 @@ mount(): () => void

#### Defined in

[derived.ts:137](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L137)
[derived.ts:165](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L165)

***

Expand All @@ -173,4 +193,4 @@ subscribe(listener): () => void

#### Defined in

[derived.ts:178](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L178)
[derived.ts:206](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L206)
4 changes: 4 additions & 0 deletions docs/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ title: "@tanstack/store"
- [DerivedFnProps](interfaces/derivedfnprops.md)
- [DerivedOptions](interfaces/derivedoptions.md)
- [StoreOptions](interfaces/storeoptions.md)

## Type Aliases

- [UnwrapDerivedOrStore](type-aliases/unwrapderivedorstore.md)
16 changes: 10 additions & 6 deletions docs/reference/interfaces/derivedfnprops.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,39 @@ id: DerivedFnProps
title: DerivedFnProps
---

# Interface: DerivedFnProps\<TState\>
# Interface: DerivedFnProps\<TState, ArrType, UnwrappedArrT\>

## Type Parameters

**TState**

**ArrType** *extends* `ReadonlyArray`\<[`Derived`](../classes/derived.md)\<`any`\> \| [`Store`](../classes/store.md)\<`any`\>\> = `ReadonlyArray`\<`any`\>

**UnwrappedArrT** *extends* `UnwrapReadonlyDerivedOrStoreArray`\<`ArrType`\> = `UnwrapReadonlyDerivedOrStoreArray`\<`ArrType`\>

## Properties

### currDepVals

```ts
currDepVals: any[];
currDepVals: UnwrappedArrT;
```

#### Defined in

[derived.ts:9](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L9)
[derived.ts:31](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L31)

***

### prevDepVals

```ts
prevDepVals: undefined | any[];
prevDepVals: undefined | UnwrappedArrT;
```

#### Defined in

[derived.ts:6](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L6)
[derived.ts:28](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L28)

***

Expand All @@ -43,4 +47,4 @@ prevVal: undefined | TState;

#### Defined in

[derived.ts:8](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L8)
[derived.ts:30](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L30)
24 changes: 11 additions & 13 deletions docs/reference/interfaces/derivedoptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@ id: DerivedOptions
title: DerivedOptions
---

# Interface: DerivedOptions\<TState\>
# Interface: DerivedOptions\<TState, TArr\>

## Type Parameters

**TState**

**TArr** *extends* `ReadonlyArray`\<[`Derived`](../classes/derived.md)\<`any`\> \| [`Store`](../classes/store.md)\<`any`\>\> = `ReadonlyArray`\<`any`\>

## Properties

### deps

```ts
deps: (Derived<any> | Store<any, (cb) => any>)[];
deps: TArr;
```

#### Defined in

[derived.ts:23](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L23)
[derived.ts:48](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L48)

***

Expand All @@ -33,19 +35,15 @@ Values of the `deps` from before and after the current invocation of `fn`

#### Parameters

**props**: [`DerivedFnProps`](derivedfnprops.md)\<`TState`\>
**props**: [`DerivedFnProps`](derivedfnprops.md)\<`TState`, `TArr`, `UnwrapReadonlyDerivedOrStoreArray`\<`TArr`\>\>

#### Returns

`TState`

#### Todo

Improve the typings to match `deps` from above

#### Defined in

[derived.ts:29](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L29)
[derived.ts:52](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L52)

***

Expand All @@ -65,7 +63,7 @@ false

#### Defined in

[derived.ts:22](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L22)
[derived.ts:47](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L47)

***

Expand All @@ -79,7 +77,7 @@ optional onSubscribe: (listener, derived) => () => void;

**listener**: `Listener`\<`TState`\>

**derived**: [`Derived`](../classes/derived.md)\<`TState`\>
**derived**: [`Derived`](../classes/derived.md)\<`TState`, readonly `any`[]\>

#### Returns

Expand All @@ -91,7 +89,7 @@ optional onSubscribe: (listener, derived) => () => void;

#### Defined in

[derived.ts:13](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L13)
[derived.ts:38](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L38)

***

Expand All @@ -107,4 +105,4 @@ optional onUpdate: () => void;

#### Defined in

[derived.ts:17](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L17)
[derived.ts:42](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L42)
18 changes: 18 additions & 0 deletions docs/reference/type-aliases/unwrapderivedorstore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
id: UnwrapDerivedOrStore
title: UnwrapDerivedOrStore
---

# Type Alias: UnwrapDerivedOrStore\<T\>

```ts
type UnwrapDerivedOrStore<T>: T extends Derived<infer InnerD> ? InnerD : T extends Store<infer InnerS> ? InnerS : never;
```

## Type Parameters

**T**

## Defined in

[derived.ts:4](https://github.com/TanStack/store/blob/main/packages/store/src/derived.ts#L4)

0 comments on commit 24a771b

Please sign in to comment.