How to use the @cycle/most-run.run function in @cycle/most-run

To help you get started, we’ve selected a few @cycle/most-run examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github milankinen / culli / examples / sum / index.js View on Github external
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}))
})
github fiatjaf / stack-forum / client / main.js View on Github external
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
      }
github aronallen / cycle-sandbox / sample / main.ts View on Github external
'./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()
});
github frptools / collectable / packages / list / visualiser / index.js View on Github external
(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);
      }
    }
github motorcyclejs / motorcyclejs / dom / perf / dbmon / main.ts View on Github external
])
}

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
  }
})

@cycle/most-run

The Cycle run() function to be used with most.js

MIT
Latest version published 5 years ago

Package Health Score

70 / 100
Full package analysis

Popular @cycle/most-run functions