Skip to content

Instantly share code, notes, and snippets.

@mxmzb
Created June 29, 2018 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxmzb/4c5c2c5fb261f4e4fa41ecca97c5e8f7 to your computer and use it in GitHub Desktop.
Save mxmzb/4c5c2c5fb261f4e4fa41ecca97c5e8f7 to your computer and use it in GitHub Desktop.
Exercise Meta
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