(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
const map = array => ({ | |
when: condition => ({ | |
then: modification => array.map( | |
(item, index, collection) => condition(item, index, collection) ? modification(item, index, collection) : item, | |
), | |
}), | |
}); | |
map([1, 2, 3]).when(number => number > 1).then(number => number * 2) // [1, 4, 6] |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
'getOwnPropertyDescriptors' in Object || ( | |
Object.getOwnPropertyDescriptors = function (Object) { | |
var | |
gOPD = Object.getOwnPropertyDescriptor, | |
gOPN = Object.getOwnPropertyNames, | |
gOPS = Object.getOwnPropertySymbols, | |
gNS = gOPS ? function (object) { | |
return gOPN(object).concat(gOPS(object)); | |
} : | |
gOPN, |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>