Code Monkey home page Code Monkey logo

Comments (7)

zaceno avatar zaceno commented on April 27, 2024 1

Yeah the only way to see the error in my codepen example is to open upp the browser dev-tools. The code-pen console seems oblivious to anything but "console.log(...)"

I used code-pen just so I could provide a working example of the bug, but I'm happy to use any other tool you may suggest.

Thanks for pointing out that the docs are out of date!

from hyperapp.

selfup avatar selfup commented on April 27, 2024 1

@tunnckoCore jsbin is great for actual debugging 😄

But CodePen is nice to share things with. The console is weird is CodePen as well haha

from hyperapp.

zaceno avatar zaceno commented on April 27, 2024 1

Doc's are fine now, as far as I'm concerned at the moment anyway :) Nice swift work!

from hyperapp.

tunnckoCore avatar tunnckoCore commented on April 27, 2024

It comes from the docs. Third argument is data, fourth is the onError hook. app.js#L75

offtopic: I hate codepan.. how can i see the mentioned error? console shows nothing.
Never like it, never will - design, feel and all.

from hyperapp.

tunnckoCore avatar tunnckoCore commented on April 27, 2024

Thanks for pointing out that the docs are out of date!

@zaceno thanks, we didn't notice that.

from hyperapp.

jorgebucaran avatar jorgebucaran commented on April 27, 2024

@zaceno Thanks for reporting, gonna fix those doc-doc-docs!

Correct signature should be:

waitThenAdd: (model, msg, data, error)

For the record, if you update the pen as follows, here's what happens.

const effects = {
    waitThenAdd: (model, msg, data, error) => {
        console.log(data) // => HTML event since onclick=${msg.waitThenAdd}
        msg.toggle()
        wait(1000)
          .then(msg.add)
          .then(msg.toggle)
          .then(() => {error('just a message')}) // => throws the error with the specified message
    }
}

from hyperapp.

jorgebucaran avatar jorgebucaran commented on April 27, 2024

@zaceno Fixed, see https://github.com/hyperapp/hyperapp#effects

Let me know if that looks good to you. I think we're done here, so I'll close, but feel free to reopen if you feel this is still incomplete.

/cc @tunnckoCore

from hyperapp.

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.