CreateStore

CreateStore initializes a store, a value that can be observed

The Nano Form API already creates all the stores necessary for the forms, but if it is necessary to create a value outside the form, the store can be used

createForm<T>(params: { name: string; initialValues?: T; resolver?: (values: T) => Record<string, any> | undefined; }) => CreateFormType<T>
import { createStore } from "ts-nano-form";

const store = createStore();
store.subscribe((value, prev) => console.log(value, prev));
store.set("a");