Skip to content

Instantly share code, notes, and snippets.

@raine

raine/index.js Secret

Created September 8, 2015 11:14
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 raine/1ede67458020fba8da6e to your computer and use it in GitHub Desktop.
Save raine/1ede67458020fba8da6e to your computer and use it in GitHub Desktop.
// 1
const renderMailFormat = curry((type, site, data, templates, format) => {
...
});
const renderMail = (...args) =>
map(apply(renderMailFormat, args), ['html', 'text']);
// 2
const renderMailFormat = curry((type, site, data, templates, format) => {
...
});
const renderMail = (type, site, data, templates) =>
map(renderMailFormat(type, site, data, templates), ['html', 'text']);
// 3
const renderMail = (type, site, data, templates) =>
const renderMailFormat = (format) => {
...
};
map(renderMailFormat, ['html', 'text']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment