Skip to content

Commit 9579a7e

Browse files
committed
refactor(form): migrate useForm to TypeScript store
Replaces useForm.svelte.ts with useForm.ts, refactoring the form logic to use Svelte stores and TypeScript interfaces. Updates imports in Form.svelte and index.ts to use the new implementation. This change improves type safety, reactivity, and maintainability of the form handling logic.
1 parent 63d1373 commit 9579a7e

File tree

4 files changed

+293
-216
lines changed

4 files changed

+293
-216
lines changed

packages/svelte5/src/components/Form.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
type VisitOptions,
1010
isUrlMethodPair,
1111
} from '@inertiajs/core'
12+
import useForm from '../useForm'
1213
import { isEqual } from 'lodash-es'
1314
import { onMount } from 'svelte'
14-
import useForm from '../useForm.svelte'
1515
1616
const noop = () => undefined
1717

packages/svelte5/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export { default as createInertiaApp } from './createInertiaApp'
77
export { default as inertia } from './link'
88
export { default as page } from './page'
99
export { type ResolvedComponent } from './types'
10-
export { default as useForm, type InertiaFormRunes, type InertiaFormProps } from './useForm.svelte'
10+
export { default as useForm, type InertiaForm, type InertiaFormProps } from './useForm'
1111
export { default as usePoll } from './usePoll'
1212
export { default as usePrefetch } from './usePrefetch'
1313
export { default as useRemember } from './useRemember'

packages/svelte5/src/useForm.svelte.ts

Lines changed: 0 additions & 214 deletions
This file was deleted.

0 commit comments

Comments
 (0)