Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {run} from "@cycle/most-run"
import DOM from "@culli/dom"
import Store, {Memory} from "@culli/store"
import Sum, {nextId} from "./Component"
const N = 100
const sliders =
Array.apply(0, Array(N)).map(() => ({id: nextId(), val: Math.floor(10 + Math.random() * 80) }))
run(Sum, {
DOM: DOM("#app"),
Store: Store(Memory({items: sliders}))
})
import Cycle from '@cycle/most-run'
import {makeDOMDriver} from '@motorcycle/dom'
import {makeGraphQLDriver, gql} from 'cycle-graphql-most-driver'
import {makeNotificationDriver} from 'cycle-notification-most-driver'
import {makeStorageDriver} from 'cycle-storage-most-driver'
import ROUTER from 'cycle-hashrouter-most-driver'
import app from './app'
Cycle.run(app, {
DOM: makeDOMDriver('#main', [
require('snabbdom/modules/props'),
require('snabbdom/modules/style')
]),
GRAPHQL: makeGraphQLDriver({
endpoint: '/graphql',
templates: {
fetchThreads: gql`
query fetchThreads {
threads {
id
messages(order: "DESC") {
text
owner {
name
}
'./widget.js',
{ DOM: sources.DOM },
['DOM'],
{
DOM: DOMMainConnector
}
).DOM).concat(sub.DOM)))
.switch()
return {
DOM: vdom$,
HTTP: sub.HTTP
};
};
run(Component, {
HTTP: makeHTTPDriver(),
DOM : makeDOMDriver('#app'),
Sandbox: makeSandboxDriver()
});
(function() {
Cycle.run(main, {
DOM: makeDOMDriver('#app-root')
});
setTimeout(() => {
function firstView(arg) {
return arg instanceof View ? arg : firstActiveView(arg);
}
function firstActiveView(state) {
return state._left.isNone() ? state.right : state._left;
}
function commitToRoot(state) {
var worker = TreeWorker.defaultPrimary().reset(state, firstActiveView(state), state.group, 2);
while(!worker.isRoot()) {
worker.ascend(2);
}
}
])
}
function main (sources: any) {
return {
DOM: sources.databases.map(mainMap)
}
}
function load (stream: Subject) {
stream.next(ENV.generateData().toArray())
Monitoring.renderRate.ping()
setTimeout(function () { load(stream) }, ENV.timeout)
}
Cycle.run(main, {
DOM: makeDOMDriver('#test-container'),
databases: function () {
const stream = subject()
load(stream)
return stream
}
})