made with esnextbin
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 R = require('ramda'); | |
var S = require('sanctuary'); | |
var getElement = R.bind(document.querySelector, document); | |
var getElements = R.bind(document.querySelectorAll, document); | |
var container = getElement('.container'); | |
var others = getElements('.other'); | |
var log = R.tap(R.bind(console.log, console)); | |
var noise = function(x){ | |
console.log(x.target); | |
}; |
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
// clear node repl | |
// \u001B[2J clear terminal | |
// \u001B[0;0f cursor back to position 0,0. | |
process.stdout.write('\u001B[2J\u001B[0;0f'); |
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 most = require('most'); | |
var s = most.iterate(function(x) { | |
return x + 1; | |
}, 0).take(100); | |
const tails = function(stream) { | |
const t = stream.multicast(); | |
return t.constant(t).startWith(t); | |
}; |
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 through = require('through2').obj; | |
var from = require('from2'); | |
var most = require('most'); | |
var count = 0; | |
var gen = function gen(size, next) { | |
if (count++ < 20) { | |
return next(null, {val: count}); | |
} | |
}; |
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 most = require('most'); | |
var multicast = require('most').multicast; | |
var snabbdom = require('snabbdom'); | |
console.log(multicast); | |
var patch = snabbdom.init([ | |
require('snabbdom/modules/class'), | |
require('snabbdom/modules/props'), | |
require('snabbdom/modules/style'), |
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
// experiment operators for most.js :D | |
import {from, of} from 'most'; | |
import {complement} from 'ramda'; | |
const siphon = (pred, fn, stream) => from([stream.filter(pred).tap(fn).chain(most.empty), stream.filter(complement(pred))]).join(); | |
const partition = (pred, stream) => from([stream.filter(pred), stream.filter(complement(pred))]); | |
const partitionList = (pred, stream) => [stream.filter(pred), stream.filter(complement(pred))]; // [Streams] | |
siphon(x => x % 2 === 0, () => console.log('side-effect'), of(2)); // => side-effect |
made with esnextbin
made with esnextbin
made with esnextbin