Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let interaction$ = createStream(vtree$ => {
return render(vtree$, "main").interaction$;
});
// [INTERACTION] <- INTENT =========================================================================
let changeName$ = createStream(interaction$ => {
return interaction$.choose("[name=name]", "input").map(event => event.target.value);
});
// [INTENT] <- MODEL ===============================================================================
let name$ = createStream((changeName$, input$) => {
return input$.merge(changeName$).startWith("");
});
// [MODEL] <- VIEW =================================================================================
let vtree$ = createStream(name$ => {
return name$.map(name => {
return (
<div>
<div class="form-group">
<label>Name:</label>
<input type="text" class="form-control">
</div>
<hr>
<h1>Hello {name}!</h1>
</div>
);
});
});
// DATA-SINK =======================================================================================
name$.subscribe(name => {
let {Rx, h, createStream, render} = require("cyclejs");
// DATA-SOURCE =====================================================================================
let input$ = Rx.Observable.fromPromise(
new Promise((resolve, reject) => {
resolve("CycleJS");
})
);
// INTERACTION =====================================================================================
let interaction$ = createStream(vtree$ => {
return render(vtree$, "main").interaction$;
});
// [INTERACTION] <- INTENT =========================================================================
let changeName$ = createStream(interaction$ => {
return interaction$.choose("[name=name]", "input").map(event => event.target.value);
});
// [INTENT] <- MODEL ===============================================================================
let name$ = createStream((changeName$, input$) => {
return input$.merge(changeName$).startWith("");
});
// [MODEL] <- VIEW =================================================================================
let vtree$ = createStream(name$ => {
return name$.map(name => {
return (
<div>
<div class="form-group">
<label>Name:</label>
<input type="text" class="form-control"></div></div>
resolve("CycleJS");
})
);
// INTERACTION =====================================================================================
let interaction$ = createStream(vtree$ => {
return render(vtree$, "main").interaction$;
});
// [INTERACTION] <- INTENT =========================================================================
let changeName$ = createStream(interaction$ => {
return interaction$.choose("[name=name]", "input").map(event => event.target.value);
});
// [INTENT] <- MODEL ===============================================================================
let name$ = createStream((changeName$, input$) => {
return input$.merge(changeName$).startWith("");
});
// [MODEL] <- VIEW =================================================================================
let vtree$ = createStream(name$ => {
return name$.map(name => {
return (
<div>
<div class="form-group">
<label>Name:</label>
<input type="text" class="form-control">
</div>
<hr>
<h1>Hello {name}!</h1>
</div>
);
// IMPORTS =========================================================================================
require("../../common/scripts/polyfills");
let {Rx, h, createStream, render} = require("cyclejs");
// INTERACTION =====================================================================================
let interaction$ = createStream(vtree$ => {
return render(vtree$, "main").interaction$;
});
// [INTERACTION] <- INTENT =========================================================================
let changeName$ = createStream(interaction$ => {
return interaction$.choose("[name=name]", "input").map(event => event.target.value);
});
// [INTENT] <- MODEL ===============================================================================
let name$ = createStream(changeName$ => {
return changeName$.startWith("");
});
// [MODEL] <- VIEW =================================================================================
let vtree$ = createStream(name$ => {
return name$.map(name => {
// IMPORTS =========================================================================================
require("../../common/scripts/polyfills");
let {Rx, h, createStream, render} = require("cyclejs");
// INTERACTION =====================================================================================
let interaction$ = createStream(vtree$ => {
return render(vtree$, "main").interaction$;
});
// [INTERACTION] <- INTENT =========================================================================
let changeName$ = createStream(interaction$ => {
return interaction$.choose("[name=name]", "input").map(event => event.target.value);
});
// [INTENT] <- MODEL ===============================================================================
let name$ = createStream(changeName$ => {
return changeName$.startWith("");
});
// [MODEL] <- VIEW =================================================================================
let vtree$ = createStream(name$ => {
return name$.map(name => {
return (
<div>
<div class="form-group">
<label>Name:</label>
<input type="text" class="form-control">
</div>
<hr>
<h1>Hello {name}!</h1>
</div>
);
// IMPORTS =========================================================================================
require("../../common/scripts/polyfills");
let {Rx, h, createStream, render} = require("cyclejs");
// INTERACTIONS ====================================================================================
let interaction$ = createStream(vtree$ => {
return render(vtree$, "main").interaction$;
});
// [INTERACTIONS] <- INTENT ========================================================================
let changeName$ = interaction$.choose("[name=name]", "input").map(event => event.target.value);
// [INTENT] <- MODEL ===============================================================================
let name$ = changeName$.startWith("");
// [MODEL] <- VIEW =================================================================================
let vtree$ = name$.map(name => {
return (
<div>
<div class="form-group">
<label>Name:</label>
<input type="text" class="form-control"></div></div>
// IMPORTS =========================================================================================
require("../../common/scripts/polyfills");
let {Rx, h, createStream, render} = require("cyclejs");
// DATA-SOURCE =====================================================================================
let input$ = Rx.Observable.fromPromise(
new Promise((resolve, reject) => {
resolve("CycleJS");
})
);
// INTERACTION =====================================================================================
let interaction$ = createStream(vtree$ => {
return render(vtree$, "main").interaction$;
});
// [INTERACTION] <- INTENT =========================================================================
let changeName$ = createStream(interaction$ => {
return interaction$.choose("[name=name]", "input").map(event => event.target.value);
});
// [INTENT] <- MODEL ===============================================================================
let name$ = createStream((changeName$, input$) => {
return input$.merge(changeName$).startWith("");
});
// [MODEL] <- VIEW =================================================================================
let vtree$ = createStream(name$ => {
return name$.map(name => {
// IMPORTS =========================================================================================
require("../../common/scripts/polyfills");
let {Rx, h, createStream, render} = require("cyclejs");
// INTERACTION =====================================================================================
let interaction$ = createStream(vtree$ => {
return render(vtree$, "main").interaction$;
});
// [INTERACTION] <- INTENT =========================================================================
let changeName$ = createStream(interaction$ => {
return interaction$.choose("[name=name]", "input").map(event => event.target.value);
});
// [INTENT] <- MODEL ===============================================================================
let name$ = createStream(changeName$ => {
return changeName$.startWith("");
});
// [MODEL] <- VIEW =================================================================================
let vtree$ = createStream(name$ => {
return name$.map(name => {
return (
<div>
<div class="form-group">
<label>Name:</label>
<input type="text" class="form-control"></div></div>
let interaction$ = createStream(vtree$ => {
return render(vtree$, "main").interaction$;
});
// [INTERACTION] <- INTENT =========================================================================
let changeName$ = createStream(interaction$ => {
return interaction$.choose("[name=name]", "input").map(event => event.target.value);
});
// [INTENT] <- MODEL ===============================================================================
let name$ = createStream(changeName$ => {
return changeName$.startWith("");
});
// [MODEL] <- VIEW =================================================================================
let vtree$ = createStream(name$ => {
return name$.map(name => {
return (
<div>
<div class="form-group">
<label>Name:</label>
<input type="text" class="form-control">
</div>
<hr>
<h1>Hello {name}!</h1>
</div>
);
});
});
// CYCLE ===========================================================================================
interaction$.inject(vtree$);
streams = mapValues(streams, (streamFn) => ({
deps: getParametersNames(streamFn),
stream: createStream(streamFn)
}));