UNPKG

@tuentyfaiv/svelte-form

Version:

A form library for Svelte. It is built on top of Svelte and Typescript. Inspired by Formik and React Hook Form.

15 lines (14 loc) 399 B
import { setContext } from "svelte"; import { readable } from "svelte/store"; export function setConfig(fields = {}) { const { field = {}, option = {}, select = {}, file = {}, errors = {}, replace = false, } = fields; const styles = readable({ replace, field, option, select, file, errors, }); setContext("faivform-styles", styles); }