question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

conversion API for dataflows (and drivers)

See original GitHub issue

Wouldn’t it be nice if it was easily possible to write app where you can use components created with different stream libraries in mind?

Scenarios where this can be useful include migrating to another stream library, or evaluating library, or it would just make possible to use shared components written for xstream in rx app and vice versa.

Convention for driver sources this could be like for isolate: A source would provide two helper methods convertSource and convertSink that would take adapter of stream lib which they should to convert to (for source) and from (for sink).

So basically those function for driver sources would do the same thing as dorivers do with runSA (that is passed as second param) while init - convert driver’s native streams to some other streams.

Though the problem is see with non driver sources, there some conventions would be needed too. But basically such sources are either streams or plain object maps with streams.

API could be taken from @TylorS’s https://github.com/TylorS/stream-conversions Maybe covertSource and convertSink should take not adapter, but conversion interface from stream-conversions

API could look like:

import RxComponent './RxComponent'
import convert from '@cycle/convert'

const XsComponent = convert.rx.to.xstream(RxComponent)

// so XsComponent can be used transparently in xstream app

Also RxComponent could have like drivers streamAdapter property that would let converter to know from which lib it should convert the dataflow. And API using adapters could look like:

import RxComponent './RxComponent'
import convertToXs from '@cycle/convert/xstream' // converter to xstream
import rxAdapter from '@cycle/rx-adapter'

const XsComponent = convertToXs(RxComponent, rxAdapter)

// if RxComponent.streamAdapter would be defined:
const XsComponent = convertToXs(RxComponent)

This is kind of raw idea. What do you think?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
wclrcommented, Jun 12, 2016
0reactions
wclrcommented, Jun 12, 2016

@staltz you could ask me to help for example. And those are kind of tasks that should be solidly accomplished once (good API should be finalized) - some time and decent efforts are required for that - this is obvious. But those libs are really small and simple (and this is the sign of good design decision and correct approach) and will serve as foundation and should not require big efforts in future.

As for adapters API - you may consider it to be necessary evil but I consider it as a good part. You still have it and drivers use it (adapters conversions). In this terms conversion API that I was taking about would be just a logical addition to this stuff that is already in place de facto.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dataflows - Power BI REST APIs - Microsoft Learn
Returns a list of data sources for the specified dataflow. Permissions This API call can be called by a service principal profile.
Read more >
REST API connections in DataFlow | ThoughtSpot Software
DataFlow enables you to connect to ingest data through REST API, to use in ThoughtSpot.
Read more >
Cookies Are Out, Conversions APIs Are In | Blog - Fivetran
Conversions APIs can receive data from offline conversions and events ... and ad delivery optimization and drives down the cost per action.
Read more >
Dataflow API | Google Cloud
It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery ......
Read more >
APIs Explorer - Google Developers
The Google APIs Explorer is is a tool that helps you explore various Google APIs ... Query the traffic source paths that lead...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found