Comments (11)
"There is no terror in the bang, only in the anticipation of it." 😛
I'll try to push it this weekend
from hitchcock.
from hitchcock.
Still very experimental but here is a demo: https://codesandbox.io/s/kk2v1op3m5
from hitchcock.
from hitchcock.
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.
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.
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:
and then i wrap with an Error Boundary:
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.
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.
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.
@tsiq-swyx looks like handling rejections was missing: facebook/react@75048c2
from hitchcock.
from hitchcock.
Related Issues (2)
- New props maybe ? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hitchcock.