Skip to content

Commit

Permalink
fix: export useStore in Solid, React, and Vue forms (#1063)
Browse files Browse the repository at this point in the history
* fix: export useStore in Solid, React, and Vue forms

* ci: apply automated fixes and generate docs

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
crutchcorn and autofix-ci[bot] authored Dec 10, 2024
1 parent 12e391e commit 3971cf3
Show file tree
Hide file tree
Showing 23 changed files with 136 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/framework/react/reference/functions/field.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ The `Field` component uses the `useField` hook internally to manage the field in

## Defined in

[useField.tsx:164](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L164)
[packages/react-form/src/useField.tsx:164](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L164)
2 changes: 1 addition & 1 deletion docs/framework/react/reference/functions/usefield.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ The `FieldApi` instance for the specified field.

## Defined in

[useField.tsx:50](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L50)
[packages/react-form/src/useField.tsx:50](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L50)
2 changes: 1 addition & 1 deletion docs/framework/react/reference/functions/useform.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ This API encapsulates all the necessary functionalities related to the form. It

## Defined in

[useForm.tsx:67](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L67)
[packages/react-form/src/useForm.tsx:67](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L67)
36 changes: 36 additions & 0 deletions docs/framework/react/reference/functions/usestore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
id: useStore
title: useStore
---

# Function: useStore()

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

## Type Parameters

**TState**

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

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

## Parameters

### store

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

### selector?

(`state`) => `TSelected`

## Returns

`TSelected`

## Defined in

node\_modules/.pnpm/@tanstack+react-store@0.6.1\_react-dom@18.3.1\_react@18.3.1\_\_react@18.3.1/node\_modules/@tanstack/react-store/dist/esm/index.d.ts:7
2 changes: 1 addition & 1 deletion docs/framework/react/reference/functions/usetransform.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ function useTransform<TFormData, TFormValidator>(fn, deps): FormTransform<TFormD

## Defined in

[useTransform.ts:3](https://github.com/TanStack/form/blob/main/packages/react-form/src/useTransform.ts#L3)
[packages/react-form/src/useTransform.ts:3](https://github.com/TanStack/form/blob/main/packages/react-form/src/useTransform.ts#L3)
1 change: 1 addition & 0 deletions docs/framework/react/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ title: "@tanstack/react-form"
- [Field](functions/field.md)
- [useField](functions/usefield.md)
- [useForm](functions/useform.md)
- [useStore](functions/usestore.md)
- [useTransform](functions/usetransform.md)
8 changes: 4 additions & 4 deletions docs/framework/react/reference/interfaces/reactformapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A React component to render form fields. With this, you can render and manage in

#### Defined in

[useForm.tsx:21](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L21)
[packages/react-form/src/useForm.tsx:21](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L21)

***

Expand Down Expand Up @@ -59,7 +59,7 @@ A `Subscribe` function that allows you to listen and react to changes in the for

#### Defined in

[useForm.tsx:35](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L35)
[packages/react-form/src/useForm.tsx:35](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L35)

***

Expand All @@ -73,7 +73,7 @@ A custom React hook that provides functionalities related to individual form fie

#### Defined in

[useForm.tsx:25](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L25)
[packages/react-form/src/useForm.tsx:25](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L25)

***

Expand Down Expand Up @@ -101,4 +101,4 @@ A `useStore` hook that connects to the internal store of the form. It can be use

#### Defined in

[useForm.tsx:29](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L29)
[packages/react-form/src/useForm.tsx:29](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L29)
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ A type alias representing a field component for a specific form data type.

## Defined in

[useField.tsx:134](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L134)
[packages/react-form/src/useField.tsx:134](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L134)
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ An extended version of the `FormApi` class that includes React-specific function

## Defined in

[useForm.tsx:44](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L44)
[packages/react-form/src/useForm.tsx:44](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L44)
2 changes: 1 addition & 1 deletion docs/framework/react/reference/type-aliases/usefield.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ A function that takes an optional object with a `name` property and field option

## Defined in

[useField.tsx:26](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L26)
[packages/react-form/src/useField.tsx:26](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L26)
2 changes: 1 addition & 1 deletion docs/framework/solid/reference/functions/createfield.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ function createField<TParentData, TName, TFieldValidator, TFormValidator, TData>

## Defined in

[createField.tsx:87](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L87)
[packages/solid-form/src/createField.tsx:87](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L87)
2 changes: 1 addition & 1 deletion docs/framework/solid/reference/functions/createform.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ function createForm<TParentData, TFormValidator>(opts?): FormApi<TParentData, TF

## Defined in

[createForm.tsx:26](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L26)
[packages/solid-form/src/createForm.tsx:26](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L26)
2 changes: 1 addition & 1 deletion docs/framework/solid/reference/functions/field.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ function Field<TParentData, TName, TFieldValidator, TFormValidator, TData>(props

## Defined in

[createField.tsx:185](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L185)
[packages/solid-form/src/createField.tsx:185](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L185)
36 changes: 36 additions & 0 deletions docs/framework/solid/reference/functions/usestore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
id: useStore
title: useStore
---

# Function: useStore()

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

## Type Parameters

**TState**

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

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

## Parameters

### store

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

### selector?

(`state`) => `TSelected`

## Returns

`Accessor`\<`TSelected`\>

## Defined in

node\_modules/.pnpm/@tanstack+solid-store@0.6.0\_solid-js@1.9.3/node\_modules/@tanstack/solid-store/dist/esm/index.d.ts:8
1 change: 1 addition & 0 deletions docs/framework/solid/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ title: "@tanstack/solid-form"
- [createField](functions/createfield.md)
- [createForm](functions/createform.md)
- [Field](functions/field.md)
- [useStore](functions/usestore.md)
8 changes: 4 additions & 4 deletions docs/framework/solid/reference/interfaces/solidformapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ createField: CreateField<TFormData, TFormValidator>;

#### Defined in

[createForm.tsx:16](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L16)
[packages/solid-form/src/createForm.tsx:16](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L16)

***

Expand All @@ -33,7 +33,7 @@ Field: FieldComponent<TFormData, TFormValidator>;

#### Defined in

[createForm.tsx:15](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L15)
[packages/solid-form/src/createForm.tsx:15](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L15)

***

Expand Down Expand Up @@ -65,7 +65,7 @@ Subscribe: <TSelected>(props) => Element;

#### Defined in

[createForm.tsx:20](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L20)
[packages/solid-form/src/createForm.tsx:20](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L20)

***

Expand Down Expand Up @@ -95,4 +95,4 @@ useStore: <TSelected>(selector?) => () => TSelected;

#### Defined in

[createForm.tsx:17](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L17)
[packages/solid-form/src/createForm.tsx:17](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L17)
2 changes: 1 addition & 1 deletion docs/framework/solid/reference/type-aliases/createfield.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ type CreateField<TParentData, TFormValidator>: <TName, TFieldValidator, TData>(o

## Defined in

[createField.tsx:29](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L29)
[packages/solid-form/src/createField.tsx:29](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L29)
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ type FieldComponent<TParentData, TFormValidator>: <TName, TFieldValidator, TData

## Defined in

[createField.tsx:160](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L160)
[packages/solid-form/src/createField.tsx:160](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L160)
36 changes: 36 additions & 0 deletions docs/framework/vue/reference/functions/usestore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
id: useStore
title: useStore
---

# Function: useStore()

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

## Type Parameters

**TState**

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

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

## Parameters

### store

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

### selector?

(`state`) => `TSelected`

## Returns

`Readonly`\<`Ref`\<`TSelected`\>\>

## Defined in

node\_modules/.pnpm/@tanstack+vue-store@0.6.0\_vue@3.5.12\_typescript@5.7.2\_/node\_modules/@tanstack/vue-store/dist/esm/index.d.ts:8
1 change: 1 addition & 0 deletions docs/framework/vue/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ title: "@tanstack/vue-form"

- [useField](functions/usefield.md)
- [useForm](functions/useform.md)
- [useStore](functions/usestore.md)
2 changes: 2 additions & 0 deletions packages/react-form/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export * from '@tanstack/form-core'

export { useStore } from '@tanstack/react-store'

export type { ReactFormApi, ReactFormExtendedApi } from './useForm'
export { useForm } from './useForm'

Expand Down
2 changes: 2 additions & 0 deletions packages/solid-form/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export * from '@tanstack/form-core'

export { useStore } from '@tanstack/solid-store'

export { createForm, type SolidFormApi } from './createForm'

export type { CreateField, FieldComponent } from './createField'
Expand Down
1 change: 1 addition & 0 deletions packages/vue-form/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from '@tanstack/form-core'
export { useStore } from '@tanstack/vue-store'
export * from './useField'
export * from './useForm'

0 comments on commit 3971cf3

Please sign in to comment.