Code Monkey home page Code Monkey logo

Comments (3)

IamCarbonMan avatar IamCarbonMan commented on May 9, 2024

https://github.com/IamCarbonMan/pokegotchi

code is here. a bit messy and written in coffeescript but as far as I can tell everything meets the docs

from hyperapp.

mshgh avatar mshgh commented on May 9, 2024

I cannot read coffeescript, but I guess this would be the same issue I run into when using subscriptions.
I cannot see anything in the documentation related to the return value of subscription unsubscribe handler, but based on the source code the only meaningful return values are undefined or false

see line 59 in

hyperapp/index.js

Lines 48 to 59 in c3717e3

subs.push(
newSub && newSub !== true
? !oldSub ||
newSub[0] !== oldSub[0] ||
shouldRestart(newSub[1], oldSub[1])
? [
newSub[0],
newSub[1],
(oldSub && oldSub[2](), newSub[0](dispatch, newSub[1])),
]
: oldSub
: oldSub && oldSub[2]()

in may case my issue was caused by using one-liner. this is failing

  ...
  return () => function_returning_something()
}

while this works perfectly fine

  ...
  return () => {
    function_returning_something()
  }
}

I am curious if changing the line 59 like this would be the fix?

        : (oldSub && oldSub[2](), false)

from hyperapp.

jorgebucaran avatar jorgebucaran commented on May 9, 2024

If you'd like, feel free to send over a patch along with a test script. If you need a hand with writing the test, just let me know and I'll be happy to help you out or show you how to get started. I hope that makes sense.

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.