Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to use Stanga ( as a wrapper, not as a driver
// Generic helper function that takes a main() (the top-level component)
// and wraps it with Stanga logic
function wrapWithStanga(main, initialState) {
return function (sources) {
const modProxy$ = new Subject();
const modelSource = Model(initialState)(modProxy$);
sources.model = modelSource;
const sinks = main(sources);
return sinks;
// Usage example
function main(sources) {
// return sinks...
const initialState = {name: 'Sara', job: 'Designer'}, initialState), {
DOM: makeDOMDriver('#app')
// See a full example at
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.