Created
May 17, 2020 18:03
-
-
Save jsmanifest/a7040f143f5651b9fd7d4019d7ffdb5a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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