Détail du package

@motorcycle/run

motorcyclets26MIT5.0.0

A statically-typed, functional and reactive framework for modern browsers

motorcycle, motorcyclets, motorcyclejs, most

readme

@motorcycle/run -- 4.1.0

A statically-typed, functional and reactive framework for modern browsers

Get it

yarn add @motorcycle/run
# or
npm install --save @motorcycle/run

API Documentation

All functions are curried!

run\<Sources, Sinks\>(Main: Component\<Sources, Sinks\>, IO: IOComponent\<Sinks, Sources\>)

Gets the Motorcycle engine roaring! This is the core of Motorcycle. It creates an application loop between your purely functional Main function, and your side-effectful IO function using @most/core. This is made possible by the use of the ES2015 Proxy. This means that Motorcycle will only support modern browsers with this feature. All major browsers, still supported by their vendors(Google, Microsoft, Apple), support this feature.

<summary>See an example</summary> typescript import { run } from '@motorcycle/run' import { makeDomComponent, div, button, h2, query, clickEvent } from '@motorcycle/dom' function Main(sources) { const { dom } = sources const click$ = clickEvent(query('button', dom)) const count$ = scan(x => x + 1, click$) const view$ = map(view, count$) return { view$ } } function view(count: number) { return div([ h2(`Clicked ${count} times`), button('Click Me'), ]) } run(Main, makeDomComponent(document.querySelector('#app')))
<summary>See the code</summary> typescript export function run< Sources extends Readonly<Record<string, any>>, Sinks extends Readonly<Record<string, Stream<any>>> >(Main: Component<Sources, Sinks>, IO: IOComponent<Sinks, Sources>) { const { stream: endSignal } = createProxy<void>() const sinkProxies = {} as Record<keyof Sinks, ProxyStream<any>> const proxySinks: Sinks = createProxySinks(sinkProxies, endSignal) const sources: Sources = IO(proxySinks) const sinks: Sinks = createDisposableSinks(Main(sources), endSignal) const disposable = replicateSinks(sinks, sinkProxies) function dispose() { endSignal.event(scheduler.currentTime(), void 0) disposable.dispose() disposeSources(sources) } return { sinks, sources, dispose } }

changelog

Change Log

@motorcycle/mostly-dom@5.0.0 (2017-10-12)

@motorcycle/run@5.0.0 (2017-10-12)

@motorcycle/dom@17.0.0 (2017-10-12)

@motorcycle/stream@3.0.0 (2017-10-12)

@motorcycle/types@3.0.0 (2017-10-12)

@motorcycle/test@3.0.0 (2017-10-12)

@motorcycle/mostly-html@1.0.0 (2017-10-12)

Implemented enhancements:

  • stream: switch from 167 to @typed/prelude #196
  • mostly-dom: switch from 167 to @typed/prelude #195
  • dom: Switch from 167 to @typed/prelude #194
  • Rename dragstartEvent to dragStartEvent #191
  • Improve @motorcycle/run semantically #189
  • Switch from 167 to @typed/prelude #174
  • mapList :: (a -> b) -> Stream (List a) -> Stream (List b) #167
  • Implement last stream combinator #163
  • Curry isolate #158
  • Create examples #36
  • chore: upgrade to typed-test v3.2.0 #205 (TylorS)
  • Chore/upgrade dependencies #181 (Frikki)

Merged pull requests:

  • Feat/state combinator #193 (TylorS)
  • feat: add drag-n-drop example #192 (TylorS)
  • Fixed README link to ./examples/sokoban #190 (deansher)
  • feat: change mapSinks to mapList and loosen type restrictions #171 (TylorS)
  • feat(stream): implement last combinator #168 (TylorS)
  • feat: create mostly-html integration #162 (TylorS)

@motorcycle/stream@2.1.0 (2017-09-15)

@motorcycle/test@2.1.0 (2017-09-15)

@motorcycle/types@2.1.0 (2017-09-15)

@motorcycle/mostly-dom@4.1.0 (2017-09-15)

@motorcycle/dom@16.1.0 (2017-09-15)

@motorcycle/run@4.1.0 (2017-09-15)

Fixed bugs:

  • switchMap not exported #155
  • Re-export switchMap in index #157 (Frikki)

Merged pull requests:

@motorcycle/mostly-dom@4.0.0 (2017-09-11)

@motorcycle/test@2.0.0 (2017-09-11)

@motorcycle/run@4.0.0 (2017-09-11)

@motorcycle/stream@2.0.0 (2017-09-11)

@motorcycle/types@2.0.0 (2017-09-11)

@motorcycle/dom@16.0.0 (2017-09-11)

Implemented enhancements:

  • @motorcycle/i18n #34
  • @motorcycle/storage #33
  • @motorcycle/http #32
  • @motorcycle/router #31
  • @motorcycle/history #30
  • @motorcycle/html #29

Fixed bugs:

  • Stream package v1.7.0 is incompatible #143
  • Type errors with latest releases #141

Closed issues:

  • Generics order of EffectfulComponent #137

Merged pull requests:

  • Upgrades dependencies across the board #147 (TylorS)

@motorcycle/run@3.6.0 (2017-08-29)

@motorcycle/dom@15.1.0 (2017-08-29)

@motorcycle/test@1.6.0 (2017-08-29)

@motorcycle/mostly-dom@3.2.0 (2017-08-29)

@motorcycle/stream@1.7.0 (2017-08-29)

@motorcycle/types@1.6.0 (2017-08-29)

Implemented enhancements:

  • Missing sample and sampleWith #92

Merged pull requests:

  • Upgrade all of the dependencies to the latest #115 (TylorS)

@motorcycle/dom@14.0.0 (2017-08-25)

@motorcycle/dom@15.0.0 (2017-08-25)

@motorcycle/run@3.5.0 (2017-08-25)

@motorcycle/stream@1.6.0 (2017-08-25)

@motorcycle/test@1.5.0 (2017-08-25)

@motorcycle/types@1.5.0 (2017-08-25)

@motorcycle/mostly-dom@3.1.0 (2017-08-25)

Merged pull requests:

  • fix(isolate): ensure query is called with valid CSS selector #108 (TylorS)
  • Feat/dom improvements #100 (TylorS)

@motorcycle/stream@1.5.0 (2017-08-21)

@motorcycle/run@3.4.0 (2017-08-21)

@motorcycle/mostly-dom@3.0.0 (2017-08-21)

@motorcycle/types@1.4.0 (2017-08-21)

@motorcycle/test@1.4.0 (2017-08-21)

@motorcycle/dom@13.1.0 (2017-08-21)

Merged pull requests:

  • feat(stream): implement sample and sampleWith #94 (TylorS)
  • chore(deps): update dependency @types/node to v8.0.24 #88 (renovate[bot])
  • chore(deps): update dependency @motorcycle/test to v1.3.0 #87 (renovate[bot])
  • chore(deps): update dependency @most/core to v0.11.4 #80 (renovate[bot])

@motorcycle/mostly-dom@2.0.0 (2017-08-14)

@motorcycle/dom@13.0.0 (2017-08-14)

@motorcycle/run@3.3.0 (2017-08-14)

@motorcycle/stream@1.4.0 (2017-08-14)

@motorcycle/test@1.3.0 (2017-08-14)

Implemented enhancements:

  • feat: combineObj #55

Merged pull requests:

@motorcycle/mostly-dom@1.1.0 (2017-08-06)

@motorcycle/dom@12.1.0 (2017-08-06)

@motorcycle/stream@1.3.0 (2017-08-06)

@motorcycle/test@1.2.0 (2017-08-06)

@motorcycle/types@1.3.0 (2017-08-06)

@motorcycle/run@3.2.0 (2017-08-06)

Implemented enhancements:

  • @motorcycle/mostly-dom #67

@motorcycle/mostly-dom@1.0.0 (2017-08-04)

@motorcycle/run@3.1.0 (2017-08-03)

@motorcycle/test@1.1.0 (2017-08-03)

@motorcycle/types@1.2.0 (2017-08-03)

@motorcycle/dom@12.0.0 (2017-08-03)

@motorcycle/stream@1.2.0 (2017-08-03)

Implemented enhancements:

  • add documentation to isolateDom #60
  • @motorcycle/dom #28
  • @motorcycle/test #27
  • chore(travis): install chrome and start display server #62 (TylorS)
  • add documentation to isolate function #61 (Frikki)

Closed issues:

  • feat: hold #57

Merged pull requests:

  • fix(EventDelegationDomSource): ensure events emit only to correct listeners #64 (TylorS)
  • chore(deps): Update dependency @typed/test to version 2.4.0 #56 (renovate[bot])
  • chore(deps): Renovate Lock File Maintenance packages #54 (renovate[bot])

@motorcycle/test@1.0.0 (2017-07-20)

Implemented enhancements:

@motorcycle/run@3.0.0 (2017-07-20)

@motorcycle/types@1.1.0 (2017-07-20)

@motorcycle/stream@1.1.0 (2017-07-20)

Implemented enhancements:

  • chore: Create documentation generation #49
  • Export scheduler from @motorcycle/stream #47
  • feat: run #26
  • Implement @motorcycle/run #52 (TylorS)
  • Generate documentation #51 (TylorS)

Merged pull requests:

  • chore(deps): Update dependency typescript to version 2.4.2 #50 (renovate[bot])

@motorcycle/stream@1.0.0 (2017-07-19)

@motorcycle/types@1.0.0 (2017-07-19)

Implemented enhancements:

  • feat: switchMerge #25
  • export switchLatest from @most/core #24
  • feat: switchCombine #23
  • feat: mapSinks #22
  • feat: switchSinkOr #21
  • feat: createProxy() #20
  • Feat: rexport @most/core #19
  • feat: EffectfulComponent type #18
  • feat: Component type #17
  • feat: re-export @most/types #16
  • docs: Code of Conduct #15
  • Document git workflow #14
  • META: Create and document issue labels #13
  • feat(stream): export scheduler instance #48 (TylorS)
  • feat(stream): implement switchMerge #46 (TylorS)
  • feat(stream): implement switchCombine #44 (TylorS)
  • feat(stream): implement mapSinks #42 (TylorS)
  • feat(stream): implement switchSinkOr #41 (TylorS)
  • Feat/issue 20 #40 (TylorS)
  • feat(stream): export switchLatest from '@most/core' #38 (TylorS)

Closed issues:

  • Motorcycle.ts Goals #3

Merged pull requests:

  • chore(deps): Pin dependency @typed/test to version 2.2.0 #45 (renovate[bot])
  • feat(stream): export all of @most/core with documentation #12 (TylorS)
  • docs(CODE_OF_CONDUCT): adds code of conduct #11 (TylorS)
  • chore(deps): Update dependency prettier to version 1.5.3 #10 (renovate[bot])
  • chore(deps): Update dependency @typed/test to version 2.x #8 (renovate[bot])
  • Configure Renovate #7 (renovate[bot])
  • chore(meta): switch back to yarn #5 (TylorS)

* This Change Log was automatically generated by github_changelog_generator