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 flyd = require('flyd'); | |
var flydEvery = require('flyd-every'); | |
var start = new Date().getTime(); | |
flydEvery(500).map(function(){ | |
console.log(new Date().getTime() - start); | |
}); |
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
class EventEmitter{ | |
emit(event){ | |
console.log(event); | |
} | |
} | |
function emits(obj, prop, descriptor){ | |
let value; delete descriptor.writable; | |
delete descriptor.value; | |
descriptor.get = () => value; |
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 descriptor = Object.getOwnPropertyDescriptor(Person.prototype, 'born'); | |
if(typeof descriptor.set === 'function'){ | |
descriptor.set(_instanceInitializers.born.call(this)); | |
} | |
else if(descriptor.get === undefined && descriptor.set === undefined) { | |
var value = _instanceInitializers.born.call(this); | |
descriptor.value = value === undefined ? descriptor.value : value; | |
} | |
Object.defineProperty(this, 'born', descriptor); |
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
console.clear(); | |
var Bacon = require('bacon.model') | |
function createAction(func){ | |
var bus = stream = new Bacon.Bus(); | |
if(func){ | |
var stream = func(bus); | |
} | |
stream.fire = function(v){ | |
console.log(v); | |
bus.push.call(bus, v) |
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
"use strict" | |
console.clear(); | |
var Bacon = require('bacon.model') | |
function createAction(func){ | |
var bus = new Bacon.Bus(); | |
if(func){ | |
var stream = func(bus); | |
} | |
else{ |
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
console.clear(); | |
var Bacon = require('bacon.model'); | |
var _ = require('lodash'); | |
_.mixin(require('lodash-deep')); | |
var Conflux = { | |
createStore: function(stream, init){ | |
var model = new Bacon.Model(init); | |
model.addSource(stream); | |
return model; |
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
//im here | |
var _ = require('lodash') | |
var Genetic = require('genetic-js') | |
var genetic = Genetic.create(); | |
genetic.optimize = Genetic.Optimize.Maximize; | |
genetic.select1 = Genetic.Select1.Tournament2; | |
genetic.select2 = Genetic.Select2.Tournament2; | |
genetic.seed = function() { |
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 Bacon = require('baconjs'); | |
var _ = require('lodash'); | |
function concat(x, y){ | |
return x.concat(y) | |
} | |
var action = new Bacon.Bus(); |
NewerOlder