Skip to content

Instantly share code, notes, and snippets.

@jsmanifest
Created May 17, 2020 18:03
Show Gist options
  • Save jsmanifest/a7040f143f5651b9fd7d4019d7ffdb5a to your computer and use it in GitHub Desktop.
Save jsmanifest/a7040f143f5651b9fd7d4019d7ffdb5a to your computer and use it in GitHub Desktop.
const callAll = (...fns) => (arg) => fns.forEach((fn) => fn && fn(arg))
function MyInput({ value, onChange, onChange2, onChange3 }) {
return (
<input
type='text'
value={value}
onChange={callAll(onChange, onChange2, onChang3)}
/>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment