UNPKG

cosmo-ui

Version:
20 lines (16 loc) 531 B
import * as React from 'react' export const mkNonPropagatingClick = (clickHandler: () => any) => (e: React.MouseEvent<any>) => { e.stopPropagation() clickHandler() } export const prevDef = (handler: (e: React.SyntheticEvent<any>) => any) => (e: React.SyntheticEvent<any>) => { e.preventDefault() handler(e) } export const eventValue = (handler: (v: string) => any) => (e: React.SyntheticEvent<any>) => { e.preventDefault() handler(e.currentTarget.value) }