Skip to content

Instantly share code, notes, and snippets.

<div id="stream-app"><div data-reactroot="" class="hs-popup-wrapper-inner"><div class="fade hide modal hs-message-modal"><div class="modal-body"><div class="hs-message hs-message-renew"><h3 class="hs-tit"><span>Your AdEspresso session has expired, please renew it</span></h3><p class="hs-text"><span>In order to keep using AdEspresso please click the button below to renew the required permissions</span></p><p class="hs-cta"><button class="btn btn-success"><span>Renew session</span></button></p></div></div></div><div><div class="hs-navbar"><div id="accordion"><div class="hs-navbar-actions"><div class="actions-primary"><a href="https://dev.adespresso.com/" target="_blank" class="btn" title="" data-placement="bottom" data-toggle="tooltip" data-animation="false" data-container="body" data-original-title="Go to AdEspresso App"><span>AdEspresso App</span></a></div><div class="actions-secondary"><span class="note"><span><em>Show data for</em> <strong>Today</strong></span></span><button class="btn btn-setting collapsed
<div><article class="hs-post hs-post-running" id="45"><header class="hs-post-header"><div class="hs-post-info"><a href="https://www.facebook.com/AdEspresso/" class="hs-post-info-avatar" target="_blank" rel="noopener noreferrer"><img src="https://scontent.xx.fbcdn.net/v/t1.0-1/p50x50/10417448_675318482537630_3910984781494205021_n.png?oh=c99dc83bd8024c3fb0ba2f80b9f5d59d&amp;oe=58E6453C"></a><div class="hs-post-details"><a href="https://dev.adespresso.com/campaign/45" class="hs-post-campaign" target="_blank" rel="noopener noreferrer">eBook Carousel - Interests - Elite Countries</a><span class="hs-post-author">AdEspresso</span><a href="https://dev.adespresso.com/campaign/45" class="hs-post-metadata" target="_blank" rel="noopener noreferrer">December 14, 2016 12:52 PM</a></div></div><div class="hs-post-content"></div><div class="hs-post-actions"><span class="icon icon-status icon-status-active" title="" data-placement="left" data-toggle="tooltip" data-animation="false" data-original-title="Campaign running"></span
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createCycleMiddleware = createCycleMiddleware;
var _xstreamRun = require('@cycle/xstream-run');
var _xstream = require('xstream');
function main(sources) {
const user$ = sources.ACTION
// .debug(action => console.log(action))
.filter(action => action.type === ActionTypes.REQUESTED_USER_REPOS)
.map(action => action.payload.user);
const request$ = user$
.map(user => ({
url: `https://api.github.com/users/${user}/repos`,
category: 'users'
function main(sources) {
const request$ = sources.ACTION
.debug(action => console.log(action)) // This gets called when I return this stream as a sink to HTTP
.filter(action => action.type === ActionTypes.REQUESTED_USER_REPOS)
.map(action => action.payload.user)
.map(user => ({
url: `https://api.github.com/users/${user}/repos`,
category: 'users'
}));
function main(sources) {
const request$ = sources.ACTION
.filter(action => action.type === ActionTypes.REQUESTED_USER_REPOS)
.map(action => action.payload.user)
.map(user => {
url: `https://api.github.com/users/${user}/repos`,
category: 'users'
})
const action$ = sources.HTTP
function cycleDriver(outgoing$) {
console.log('cycleDriver')
outgoing$.addListener({
next: outgoing => {
console.log('outgoing', outgoing)
// sock.send(outgoing));
},
error: () => {},
complete: () => {},
@lmatteis
lmatteis / main.js
Last active November 28, 2016 15:49
Redux-cycle-middleware
// Here's how Async is done using Redux-Observable.
// The problem is that we still have side-effects in our epics (ajax.getJSON)
const fetchUserEpic = action$ =>
action$.ofType(FETCH_USER)
.mergeMap(action =>
ajax.getJSON(`https://api.github.com/users/${action.payload}`)
.map(fetchUserFulfilled)
);
// With Cycle.js we can push them even further outside our app using drivers.
set tabstop=2 " tab width is 4 spaces
set shiftwidth=2 " indent also with 4 spaces
set expandtab
syntax on " syntax highlighting
filetype indent on " activates indenting for files
set autoindent " auto indenting
set number " line numbers
colorscheme desert " colorscheme desert
set nobackup " get rid of anoying ~file
set scrolloff=10
# minimal status line with clock flush right
hardstatus alwayslastline "%{=b}%{G} : %{b}%w %=%{kG}%C%A"
# copy screen clipboard to mac clipboard
bind b eval "writebuf" "exec sh -c 'pbcopy < /tmp/screen-exchange'"
# enable bold
attrcolor b ".I"
# allow 256 colors