GithubHelp home page GithubHelp logo

It's killing me! about hitchcock HOT 11 CLOSED

tsiq-swyx avatar tsiq-swyx commented on May 12, 2024
It's killing me!

from hitchcock.

Comments (11)

pomber avatar pomber commented on May 12, 2024

"There is no terror in the bang, only in the anticipation of it." 😛
I'll try to push it this weekend

from hitchcock.

tsiq-swyx avatar tsiq-swyx commented on May 12, 2024

from hitchcock.

pomber avatar pomber commented on May 12, 2024

Still very experimental but here is a demo: https://codesandbox.io/s/kk2v1op3m5

from hitchcock.

tsiq-swyx avatar tsiq-swyx commented on May 12, 2024

from hitchcock.

tsiq-swyx avatar tsiq-swyx commented on May 12, 2024

any idea what happens when promises get rejected? they seem to be saying on twitter that componentDidCatch should be able to catch the rejected promise, but my experiments don't seem to be bearing this out.

from hitchcock.

pomber avatar pomber commented on May 12, 2024

Are you talking about hitchcock or react suspense in general?

For hitchcock it's not implemented yet.

For the rest of the cases, I think it depends on the cache you are using if you are using any. Apparently, the cache should handle the promise rejection, store the error and throw it the next time you try to read that key.

Here is how simple-cache-provider does it.

from hitchcock.

tsiq-swyx avatar tsiq-swyx commented on May 12, 2024

i think this applies to both.

so just to be clear we're on the same page, i add a throw (or a reject) in your API:
image

and then i wrap with an Error Boundary:

image

I understand that you havent implemented the reject caching in your cache, but i tried this error boundary catching with simple cache provider yesterday and it didnt work at all. just says unhandled rejection. im wondering if they havent shipped error boundaries that can handle this yet.

from hitchcock.

pomber avatar pomber commented on May 12, 2024

I just tested it with simple-cache-provider and got the same result as you, the error boundary didn't catch it. I've read that react 16.3 included a rewrite of error boundaries, maybe the alpha version we are using doesn't have that code merged.

from hitchcock.

tsiq-swyx avatar tsiq-swyx commented on May 12, 2024

ah ok so at least im not fundamentally misunderstanding something. thanks very much! keeping a close watch on this one. i def think the debugger belongs in react devtools eventually

from hitchcock.

pomber avatar pomber commented on May 12, 2024

@tsiq-swyx looks like handling rejections was missing: facebook/react@75048c2

from hitchcock.

tsiq-swyx avatar tsiq-swyx commented on May 12, 2024

from hitchcock.

Related Issues (2)

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.