@thisisagile/easy-react
Version:
Straightforward library building micro applications in react
1 lines • 710 B
Source Map (JSON)
{"version":3,"sources":["../src/utils/useState.ts"],"sourcesContent":["import { Dispatch, SetStateAction, useState as useReactState } from 'react';\n\nexport function useState<T>(): [T | undefined, Dispatch<SetStateAction<T | undefined>>, () => void];\nexport function useState<T>(initial: T): [T, Dispatch<SetStateAction<T>>, () => void];\nexport function useState<T>(initial?: T) {\n const [state, setState] = useReactState(initial);\n const reset = () => setState(initial);\n return [state, setState, reset] as const;\n}\n"],"mappings":";AAAA,SAAmC,YAAY,qBAAqB;AAI7D,SAAS,SAAY,SAAa;AACvC,QAAM,CAAC,OAAO,QAAQ,IAAI,cAAc,OAAO;AAC/C,QAAM,QAAQ,MAAM,SAAS,OAAO;AACpC,SAAO,CAAC,OAAO,UAAU,KAAK;AAChC;","names":[]}