Skip to content

Instantly share code, notes, and snippets.

@nickbalestra
nickbalestra / duck-on-wheels.js
Created December 28, 2016 20:51
An example of Duck Redux Reducer Bundle with Cycle.js apps to handle async
import xs from 'xstream'
import { combineCycles } from 'redux-cycle-middleware'
import { push } from 'react-router-redux'
import { API_URL } from '../constants/api'
// ACTION TYPES (Format: app-name/reducer/ACTION_TYPE)
// =======================================================
const LOGIN = 'app-name/auth/LOGIN'
const LOGIN_SUCCESS = 'app-name/auth/LOGIN_SUCCESS'
const LOGIN_FAIL = 'app-name/auth/LOGIN_FAIL'
@staltz
staltz / streamio.js
Created October 3, 2016 13:22
Playful Haskell Stream I/O with ES6 Generators
function *main() {
const confirmRequest = {
type: 'confirm',
value: 'Are you sure?',
};
const confirmResponse = yield confirmRequest;
if (confirmResponse === true) {
const consoleRequest = {
type: 'console',