Created
April 2, 2019 15:46
-
-
Save dougdroper/2e9364b363bcf3bf6a78f52d05be0f6d to your computer and use it in GitHub Desktop.
HELP
This file contains 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 foo = ({bar}) => ({foo: `hellllllo ${bar}`}) | |
const myDefaultFn = (args) => {...args} | |
const overRides = { | |
doug: (...args) => foo(args), | |
...catchEverythingElsePlease: (...args) => myDefaultFn(args) | |
} | |
overRides['doug']({bar: "doug"}) | |
overRides['dom']({bar: "Dominic"}) # should default to something |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment