UNPKG

@uiw/react-signature

Version:

A signature board component for react.

30 lines 740 B
import _extends from "@babel/runtime/helpers/extends"; import { createContext, useContext } from 'react'; export var defaultOptions = { size: 6, smoothing: 0.46, thinning: 0.73, streamline: 0.5, easing: t => t, start: { taper: 0, easing: t => t, cap: true }, end: { taper: 0, easing: t => t, cap: true } }; export var OptionContext = /*#__PURE__*/createContext(defaultOptions); export var OptionDispatchContext = /*#__PURE__*/createContext(() => {}); export function reducerOption(tasks, action) { return _extends({}, tasks, action); } export var useOptionStore = () => { return useContext(OptionContext); }; export var useOptionDispatch = () => { return useContext(OptionDispatchContext); };