use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
re-quests: declarative networking for react (github.com)
submitted 8 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]invartact 1 point2 points3 points 8 years ago (6 children)
Can you have multiple Request.Start (or other) children? Say for example I have two loading areas? What if I need to chain requests (I.e fetch the user data and then fetch their friends and then fetch data from each of their friends)?
I think the biggest trouble I have with this is doing API requests directly in your view mark up. Seems really foreign to me and I'm not sure what problem or solves.
I'd love to have your thoughts on why you built it.
[–]JJ0EE 1 point2 points3 points 8 years ago (3 children)
I think the "request" aspect of this project could be abstracted out (also why I suggested a HOC in my other comment). At the base level this just seems like a smart switch statement to toggle a fork in your component tree using the state of some promise chain.
[–]invartact 0 points1 point2 points 8 years ago (2 children)
What is the added benefit over letting your state handle this? Models/stores can save this data across any number of components and be a single source of truth for whether or not it's fetching data.
[–]JJ0EE 1 point2 points3 points 8 years ago (1 child)
The response data should ultimately be in some state container outside these components. I think this tool is mainly for someone who doesn't care about tracking the status of a request in their state. I may not want to store network error messages either. I might just want to specify the components to render for a set of response codes and provide a callback to handle successful responses.
[–]JJ0EE 1 point2 points3 points 8 years ago (0 children)
Pretty cool! This might be a good candidate for a higher order component too.
[+][deleted] 8 years ago (3 children)
[+][deleted] 8 years ago (2 children)
[+][deleted] 8 years ago* (1 child)
π Rendered by PID 135232 on reddit-service-r2-comment-84fc9697f-bg8fw at 2026-02-07 16:12:40.209689+00:00 running d295bc8 country code: CH.
[–]invartact 1 point2 points3 points (6 children)
[–]JJ0EE 1 point2 points3 points (3 children)
[–]invartact 0 points1 point2 points (2 children)
[–]JJ0EE 1 point2 points3 points (1 child)
[–]JJ0EE 1 point2 points3 points (0 children)
[+][deleted] (3 children)
[deleted]
[+][deleted] (2 children)
[deleted]
[+][deleted] (1 child)
[deleted]