@modular-forms/solid
Version:
The modular and type-safe form library for SolidJS
12 lines (11 loc) • 312 B
JavaScript
/**
* Creates a custom transformation functions.
*
* @param action The transform action.
* @param options The transform options.
*
* @returns A transformation functions.
*/
export function toCustom(action, { on: mode }) {
return (value, event) => event.type === mode ? action(value, event) : value;
}