Created
April 11, 2019 20:17
-
-
Save adrian-afergon/4a532c0524a1c0897f056614e52157d3 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
export const createAnExercise = ({ | |
warning = 'irrelevant warning message', | |
tags = [] as string[], | |
name = 'irrelevant name', | |
image = 'irrelevant image url' | |
// ... at less 20 props | |
} as Exercise): Exercise => ({ | |
warning, | |
tags, | |
name, | |
image, | |
// ... at less 20 props | |
}); | |
// const aExercise = createAnExercise({}); // it will return the default values | |
// const aExercise = createAnExercise({warning: 'This is a warning message'}); // it will return the default values, but setting the param value for warning |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment