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
export const of = x => ({ '@@type': 'A', x }) | |
export const f1 = a => a.x | |
f1.arity = 1 | |
export const f2 = c => a => a.x + c | |
f2.arity = 2 | |
export const f3 = d => c => a => a.x + c + d | |
f3.arity = 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
export const f1 = a => a.x | |
f1.arity = 1 | |
export const f2 = c => a => a.x + c | |
f2.arity = 2 | |
export const f3 = d => c => a => a.x + 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
{ | |
"basics": { | |
"name": "Fabiano Taioli", | |
"label": "Developer", | |
"picture": "http://www.gravatar.com/avatar/e700256406c0274e61418a575900dc76.png", | |
"email": "[email protected]", | |
"phone": "(+39) 3471150092", | |
"website": "", | |
"summary": "Growing up with Internet. Enthusiast of all open source technologies that are part of the web and their applications. I am discovering and loving functional programming more and more.", | |
"location": { |
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
function todoList (deferred) { | |
const ping$ = xs.create({ | |
start: function (listener) { | |
setTimeout(() => { | |
;[...Array(config.iterations).keys()].forEach(i => | |
listener.next(i) | |
) | |
}, 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
function todoList (deferred) { | |
const ping$ = fromArray([...Array(config.iterations).keys()]) | |
const todo$ = multicast(map(todo, ping$)) | |
const old$ = merge( | |
map(todo => (todo.id % 4 === 0 ? todo : {}), take(1, todo$)), | |
filter(todo => todo.id % 4 === 0, skip(1, todo$)) | |
) | |
const sample$ = snapshot( | |
(old, last) => ({...last, old}), | |
old$, |
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
function todoList (deferred) { | |
const list = [] | |
let old = {} | |
for (let i = 0; i < config.iterations; i++) { | |
const t = todo() | |
old = t.id % 4 === 0 ? { ...t } : old | |
t.old = { ...old } | |
list.push(t) | |
} | |
return deferred.resolve(list) |
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
function todoList (deferred) { | |
const ping$ = new R.Observable(listener => { | |
setTimeout(() => { | |
;[...Array(config.iterations).keys()].forEach(i => listener.next(i)) | |
}, 0) | |
}) | |
const todo$ = RO.share()(RO.map(todo)(ping$)) | |
const old$ = RO.startWith({})(RO.filter(todo => todo.id % 4 === 0)(todo$)) | |
const sample$ = RO.map(([last, old]) => ({ | |
...last, |
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
import { induce as imperativeInduce } from '../imperative.mjs' | |
import { induce as mostInduce } from '../most.mjs' | |
import { induce as xstreamInduce } from '../xstream.mjs' | |
import { induce as rxjsInduce } from '../rxjs.mjs' | |
import { typeWriter } from './common.mjs' | |
import memwatch from '@HolgerFrank/node-memwatch' | |
const type = process.argv[2] | |
const cycles = parseInt(process.argv[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
import { induce as mostInduce } from '../most.mjs' | |
import { induce as xstreamInduce } from '../xstream.mjs' | |
import { induce as rxjsInduce } from '../rxjs.mjs' | |
import { induce as imperativeInduce } from '../imperative.mjs' | |
import { typeWriter } from './common.mjs' | |
import memwatch from '@HolgerFrank/node-memwatch' | |
const type = process.argv[2] | |
const cycles = parseInt(process.argv[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
RxJS | Xstream | Most/Core | |
---|---|---|---|
map | map | map | |
withLatestFrom | sampleCombine | snapshot | |
scan | fold | scan | |
take | take | take | |
filter | filter | filter | |
share | - | multicast |