Created
June 29, 2018 10:47
-
-
Save mxmzb/4c5c2c5fb261f4e4fa41ecca97c5e8f7 to your computer and use it in GitHub Desktop.
Exercise Meta
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
class ExerciseMeta { | |
constructor(metaArr) { | |
// ... noise | |
} | |
format(type, value) { | |
// ... noise | |
return ["somevalue"] | |
} | |
getFormatted({ separator }) { | |
// ... noise | |
const strCombinations = ["array", "of", "values"]; | |
const finalString = strCombinations.join(separator); // this is what's not working | |
return finalString; | |
} | |
} | |
formatExerciseMeta = (meta, separator) => { | |
return new ExerciseMeta(meta).getFormatted({ separator }); | |
}; | |
const Component = () => { | |
return ( | |
<Text> | |
{formatExerciseMeta( | |
exercise.workoutMeta, | |
<Icon type="ionicon" name="ios-close" /> | |
)} | |
</Text> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment