motorcyclejs / motorcycle

Open discussions for features/issues unrelated or general to current libraries.
15 stars 1 forks source link

support Cycle.js adapters #21

Closed TylorS closed 7 years ago

TylorS commented 8 years ago

Overview

A future release of Cycle.js will support the use of adapters to become observable/stream implementation agnostic. Driver functions will need to be annotated to say what adapter is needed to convert it's streams. Complex drivers which do not simply return a single stream (DOM Driver) will be passed a conversion function as the second parameter to manually do the conversion where applicable.

e.g.

import {mostAdapter} from '@cycle/most-adapter'
...
const makeDomDriver = (...) => {
- const domDriver = vTree$ => {...}
+ const domDriver = (vTree$, convert) => {...}
+ domDriver.adapter = mostAdapter
  return domDriver
}

Motivation

Allow all Cycle.js application to use drivers written in any observable/stream implementation.