Take Cycle's primal example, on the README:
import Cycle from 'cyclejs';
let {Rx, h} = Cycle;
let name$ = Cycle.createStream(function model(changeName$) {
Take Cycle's primal example, on the README:
import Cycle from 'cyclejs';
let {Rx, h} = Cycle;
let name$ = Cycle.createStream(function model(changeName$) {
'use strict'; | |
var React = require('react-native'); | |
var Cycle = require('cyclejs'); | |
var {Rx, h} = Cycle; | |
var createExperimentalIOSRenderer = require('./src/ios-renderer.ios.js'); | |
var {StyleSheet, Text, TextInput, View} = React; | |
var styles = StyleSheet.create({ | |
container: { |
Rough sketch of how is the flow of data in Mercury.
│
Event channels <───────────── dom-delegator (events)
│ │ ^
V (imperative) │
View state │ DOM
Cycle custom elements decouple the component's abstraction from its implementation.
When you use a React component like
<div>
<NewHotness />
</div>
You are pulling in that specific NewHotness component. You actually had to explicity import the NewHotness component before using it.
/** | |
* Delays all items from the source Observable up until when the other Observable | |
* emits its first item. After the other Observable emitted its first item, | |
* the source items are not delayed. | |
* | |
* source: ---s-s---s----------s---s----s---s---s--|> | |
* other: ------------o------o-------o------o-----|> | |
* result: ------------sss-----s---s----s---s---s--|> | |
* | |
* @param first |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
var Q = require('q'); | |
function delaydo(x) { | |
var deferred = Q.defer(); | |
setTimeout(function() { | |
if (x === 2) { | |
console.log("reject: "+x); | |
deferred.reject(x); | |
} | |
else { |
var Q = require('q'); | |
function delaydo(x) { | |
var deferred = Q.defer(); | |
setTimeout(function() { | |
if (x === 2) { | |
console.log("reject: "+x); | |
deferred.reject(x); | |
} | |
else { |
var Q = require('q'); | |
function delaydo(x) { | |
var deferred = Q.defer(); | |
setTimeout(function() { | |
if (x === 2) { | |
console.log("reject: "+x); | |
deferred.reject(x); | |
} | |
else { |
A useful list of programming jargon to solve your naming problems.
Adapter: a design pattern that translates one interface for a class into a compatible interface.
Admin: short for 'administrator'; very commonly used in speech or online to refer to the systems person in charge on a computer. Common constructions on this include sysadmin and site admin (emphasizing the administrator's role as a site contact for email and news).
Counter: a variable or user interface that counts occurrences or repetitions of some phenomena or event.