This file contains 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 Cycle from '@cycle/core'; // the core Cycle | |
import {h, makeDOMDriver} from '@cycle/dom'; // this is a side effect driver | |
import Rx from 'rx'; // RxJS | |
function main({DOM}) { // our Cycle app, it's simple a function | |
const DEFAULT_VALUE = 50; // a default config | |
// we select and watch our slider input from the DOM which is comes in via our function definition | |
// these avents are turned into Rx streams | |
let changeValue$ = DOM.select('#slider').events('input') |
This file contains 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
// ---------- Default Binding --------- | |
// | |
function aFoo(){ | |
console.log(this.aBar); // this is undefinied or global unless in strict mode | |
} | |
var aBar = "Default bar1"; | |
aFoo(); // default binding rule | |
var a_o2 = {aBar: "Default bar2", aFoo: aFoo}; | |
var a_o3 = {aBar: "Default bar3", aFoo: aFoo}; | |
a_o2.aFoo(); a_o2.aFoo(); // implicit binding rule |
This file contains 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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder