Giter VIP home page Giter VIP logo

Comments (3)

staltz avatar staltz commented on June 15, 2024

If I wrap them the other way, onion state is available inside the component instantiated by modalify - but modalify fails to work, for reasons I did not debug.

@kylecordes First I'd try to figure out what went wrong with that approach. Note than when doing onionify(foo), the foo is written in a way that assumes that sources.onion is available, so what onionify() is doing is just building that sources.onion and passing it to the foo. So replace foo with modalify(App) and it means modalify(App) should be written in a way that assumes sources.onion is available.

from cycle-onionify.

kylecordes avatar kylecordes commented on June 15, 2024

@staltz It seems likely I could dig through and figure it out, the source is not very long:

https://github.com/cyclejs-community/cyclejs-modal/blob/master/src/modalify.ts

... When I get a chance I will fork both, add whatever bits of debugging I need, and track it down.

More broadly, it seems like a composeability challenge. Each add-on is written and documented and tested assuming it will be the outermost wrapper. From the point of view of each, the course of action is to put it on the outside and then go debug the other add-on to figure out why it doesn't work when it's not on the outside.

Is there any way to get traction on the broader challenge? To consume a set of Cycle add-ons, and have them compose out-of-the box? It seems like trying each permutation of nesting order and debugging why a particular combination of things doesn't work together when composed in a certain order, would not scale very well to n available add-ons of which application consumes k. I've forgotten the exact formula for permutations P(n,k), but it involves factorials, and gets ugly fast.

Maybe it will turn out that there is some set of rules and way of testing for those rules, that a Cycle add-on could follow if it needs to ship as a wrapper function, such that it can be expected to compose in a predictable way with other wrapper functions?

from cycle-onionify.

jvanbruegge avatar jvanbruegge commented on June 15, 2024

You basicly have to compose them based on the features you want where. If you want state in a modal, you would have to put the state around the modal. I have no idea why this dies not wirk, please open an issue for that.

from cycle-onionify.

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.