Giter VIP home page Giter VIP logo

Comments (6)

lmatteis avatar lmatteis commented on July 25, 2024

@goshakkk @nickbalestra I'm thinking of this:

// `Cycle` can be xstream or rxjs or anything else
var output = Cycle.run(main, { ACTION: makeActionDriver(), STATE: makeStateDriver() })
const cycleMiddleware = createCycleMiddleware(output);

Problem is that the ACTION driver needs access to store so we need to create the drivers in the middleware (as it is now).

Maybe we can just keep the API as it is, but add an extra arg to createCycleMiddleware which is the actual run method to use internally:

import {run} from '@cycle/xstream-run';
const cycleMiddleware = createCycleMiddleware(main, { HTTP: makeHTTPDriver() }, run);

Thoughts?

from redux-cycles.

goshacmd avatar goshacmd commented on July 25, 2024

The second one with passing run looks more appropriate.

One thing worth keeping in mind is the fact that Cycle might become xstream-only internally and will make users themselves responsible for converting sources from xstreams and sinks to xstream if they choose to use another library. It's not set in stone yet, of course, but here is the thread for reference: cyclejs/cyclejs#425

from redux-cycles.

nickbalestra avatar nickbalestra commented on July 25, 2024

from redux-cycles.

lmatteis avatar lmatteis commented on July 25, 2024

Interesting, does this mean that all drivers must be xstream compatible?

from redux-cycles.

lmatteis avatar lmatteis commented on July 25, 2024

@goshakkk it doesn't seem like Cycle will be xstream-only: https://gitter.im/cyclejs/cyclejs?at=585bcfc496a565f844067997

Unless I misunderstood what you were trying to say.

from redux-cycles.

lmatteis avatar lmatteis commented on July 25, 2024

Ah it seems that the only difference is that we won't have to use runStreamAdapter. But passing the run is something that we'll need to do in order to support other stream libs.

from redux-cycles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.