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
const Cycle = require('cycle-react'); | |
const React = require('react'); | |
const ReactDOM = require('react-dom'); | |
const Rx = require('rx'); | |
const Counter = Cycle.component('Counter', (interactions, props) =>{ | |
return props.get('counter').map(counter =>{ | |
var now = new Date().getTime(); | |
var distance = props.value.countDownDate - now; | |
var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
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
_.chunk(['a', 'b', 'c', 'd'], 2); | |
// => [['a', 'b'], ['c', 'd']] | |
_.chunk(['a', 'b', 'c', 'd'], 3); | |
// => [['a', 'b', 'c'], ['d']] |
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
_.compact([0, 1, false, 2, '', 3]); | |
// => [1, 2, 3] |
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
var array = [1]; | |
var other = _.concat(array, 2, [3], [[4]]); | |
console.log(other); | |
// => [1, 2, 3, [4]] | |
console.log(array); | |
// => [1] |
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
_.difference([2, 1], [2, 3]); | |
// => [1] |
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
_.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); | |
// => [1.2] | |
// The `_.property` iteratee shorthand. | |
_.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); | |
// => [{ 'x': 2 }] |
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
_.drop([1, 2, 3]); | |
// => [2, 3] | |
_.drop([1, 2, 3], 2); | |
// => [3] | |
_.drop([1, 2, 3], 5); | |
// => [] | |
_.drop([1, 2, 3], 0); |
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
_.dropRight([1, 2, 3]); | |
// => [1, 2] | |
_.dropRight([1, 2, 3], 2); | |
// => [1] | |
_.dropRight([1, 2, 3], 5); | |
// => [] | |
_.dropRight([1, 2, 3], 0); |
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
// dropWhile | |
var users = [ | |
{ 'user': 'barney', 'active': false }, | |
{ 'user': 'fred', 'active': false }, | |
{ 'user': 'pebbles', 'active': true } | |
]; | |
_.dropWhile(users, function(o) { return !o.active; }); | |
// => objects for ['pebbles'] |
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
// intersection | |
_.intersection([2, 1], [2, 3]); | |
// => [2] | |
// intersectionBy | |
_.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); | |
// => [2.1] | |
OlderNewer