Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const sinks = {
DOM: appView(sandbox.DOM),
store: Observable.merge(route$, sandbox.data)
.scan(merge, {}),
};
return sinks;
}
// Note: drivers use xstream
function dummyDriver(initialValue) {
return (value$) => value$.remember().startWith(initialValue);
}
run(main, {
DOM: makeDOMDriver('#app-container'),
store: dummyDriver({}),
});
*/
if (process.env.NODE_ENV !== 'production') {
middlewares.push(require('redux-freeze')); // eslint-disable-line global-require
}
const store = createStore(
reducer,
initialState,
composeEnhancers(applyMiddleware(...middlewares)),
);
/**
* redux-cycles
* Remind: MUST create sotre first.
*/
run(main, {
ACTION: makeActionDriver(),
STATE: makeStateDriver(),
Time: timeDriver,
HTTP: makeHTTPDriver(),
STORAGE: storageDriver,
});
return store;
};
function main(sources) {
const List = makeCollection({
item: child,
collectSinks: instances => ({
onion: instances.pickMerge('onion')
}),
});
const obs = List(sources).onion;
t.is(typeof obs.switchMap, 'function');
return {
onion: Observable.never(),
};
}
run(onionify(main), {dummy: () => {}});
});
}));
appList$.subscribe(s => console.log(`Search Term: \'${s.filter}\' | Filtered Doc List: `, s.list));
const vdom$ = appList$.map(m => div('.container', [
input('.input'),
ul('.application-list', { style: { 'list-style-type': 'none', 'padding': '0px' } },
m.list.map(n => li('.application-list-item', n.qDocName)))
]));
return {
DOM: vdom$
};
}
run(main, {
DOM: makeDOMDriver('#app-container'),
});
appList$.subscribe(s => console.log(`Search Term: \'${s.filter}\' | Filtered Doc List: `, s.list));
const vdom$ = appList$.map(m => div('.container', [
input('.input', { attr: { 'placeholder': 'Filter' } }),
ul('.application-list', { style: { 'list-style-type': 'none', 'padding': '0px' } },
m.list.map(n => li('.application-list-item', [
div(n.qDocName + ` (${n.server})`)
])))
]));
return {
DOM: vdom$
};
}
run(main, {
DOM: makeDOMDriver('#app-container'),
});
.then(() => {
run(App, drivers);
})
.catch(function (err) {
ul([
li(['Option 1']),
li(['Option 2']),
li(['Option 3']),
li(['Option 4']),
li(['Option 5']),
li(['Option 6'])
])
);
return {
DOM: vdom$
};
}
run(main, {
DOM: makeDOMDriver('#app'),
drag: userSelectDriver
});
function modal({ DOM }: Sources): Sinks {
return {
DOM: observableOf(
div('.div', [
span('.span', ['This is an rxjs modal! :)']),
button('.button', ['close'])
])
),
modal: DOM.select('.button')
.events('click')
.pipe(mapTo({ type: 'close' } as ModalAction))
};
}
run(modalify(main), {
DOM: makeDOMDriver('#app')
});
li('.li', '', ['Option 5']),
li('.li', '', ['Option 6'])
])
])
).let(
makeSortable>(DOM, {
parentSelector: '.ul'
})
);
return {
DOM: vdom$
};
}
run(main, {
DOM: makeDOMDriver('#app')
});
div([
'Height ' + height + 'cm',
input('#height', {
attrs: {type: 'range', min: 140, max: 210, value: height}
})
]),
h2('BMI is ' + bmi)
])
);
return {
DOM: vdom$,
};
}
run(main, {
DOM: makeDOMDriver('#main-container')
});