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
Styleguide: Email related styleguide is in the ns-email branch: | |
https://github.com/change/styleguide/tree/ns-emails | |
email_templates.en-US.yml -- This is the file where English phrases used in emails are stored, so | |
that they can be pulled into OneSky and translated. | |
Action Alert Emails: | |
Action alert emails are emails that call for an action, such as signing or starting petition. | |
Historically they're sent by campaigners (representing Change); as Change.org platform grows, |
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
CURRY | |
Definition from Lodash _.curry(func, [arity=func.length]): | |
Creates a function that accepts arguments of func and either invokes func returning its result, if at least arity number of arguments have been provided, or returns a function that accepts the remaining func arguments, and so on. | |
currying => partially applying functions | |
Example: | |
const match = curry((what, s) => s.match(what)); | |
const hasLetterR = match(/r/g); |
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
Q from last week: Why Lodash uses "flow" instead of "compose"? | |
Lodash v1 and v2 have _.compose | |
In Lodash v3, _.compose is equal to _.flowRight | |
In Lodash v4, _.compose no longer exists. There are only _.flow and _.flowRight | |
The Lodash _.compose's concept is that it composes functions f(), g(), h() as f(g(h())), | |
so it's a _.flowRight where the order of functions executed are from left to right, unlike | |
the generic "compose" concept of right to left. |