From 04290b8e455efccb6cca7e1dc70e144aea0e63cb Mon Sep 17 00:00:00 2001 From: Gustavo Fenilli Date: Tue, 31 Oct 2023 15:34:43 -0300 Subject: [PATCH] docs: adds missing docs for initial state and adds roadmap section --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d82dab..c544dbe 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,8 @@ This project aims to seamlessly integrate Inertia.js with FormKit forms, leverag 2. [States](#states) 3. [Event Functions](#event-functions) 3. [Event System](#event-system) -4. [Types](#types) +4. [Roadmap](#roadmap) +5. [Types](#types) ## Quick Start @@ -60,6 +61,14 @@ And that is it, now you're ready to look more into the available features of thi To make integration between FormKit and Inertia easier we include a form helper composable designed to reduce the boilerplate needed for handling form submissions, it by default creates the event system, add method calls and reactive states, and it will also add default behaviours to FormKit forms like loading, disabling and setting errors that come from your backend. +The `useForm()` accepts a single optional parameter that is the initial fields of your form: + +```ts +const form = useForm({ + email: 'foo@bar.baz', +}) +``` + > Remember that for everything to work as expected you should add the returned plugin to FormKit: `:plugins="[form.plugin]"`. ### Method Calls @@ -284,6 +293,13 @@ router.post('/login', options)

(back to top)

+## Roadmap + +- [] Make the `success` and `error` events to be able to return a `Promise` to delay the call to the `finish` event +- [] Add support for [Laravel Precognition](https://laravel.com/docs/10.x/precognition) + +

(back to top)

+ ## Types