-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@client(Loader) #39
@client(Loader) #39
Conversation
where’s the favorite button when you need it? |
I was planning on solving this via #2. (I have a project that's in production that'll require this functionality as well!) However, I don't want to pollute I've been thinking about this a lot, as you can tell in the novella below! (See the bottom of the post for Eric's Gut Instinct™) Loading...This is primarily for the client, but, in my experience, very specific to the I, like most React users, started writing code with lots of Loading... messages, but the screen quickly gets overwhelmed with them. For data-rich components (e.g. "Controllers" that grab the majority of data for the rest of the render tree), this still makes a lot of sense!
Failures & ErrorsIt seems to me that, in most cases, rather than rendering the original base component you would:
TBH, the team is still determining the best behavior for this. For the moment, the Option 1 solves this well. The other thing is that, again, in my case, there's a different behavior depending on which prop is missing! With this in mind, I was considering recommending leveraging the The thing is, the following feels wrong to me:
As you can see, I've been poring over this considerably. If you were to put a gun to my head and say PICK A SOLUTION RIGHT NOW!, it'd be:
|
@ericclemmons waiting desperatly for this feature. Currently we use react-transmit, because it supports loading. I vote for:
|
@max-zelinski I'm sorry about that. I'm sprinting on a major project using This will be fixed. |
@ericclemmons Over a month later, how's that sprint going with this? |
Mostly here: Several more updates to come. |
v2 has a |
@ericclemmons i am faced with problem. I am using In |
@ruscoder Can you provide an example? I have nearly the same code functioning in projects (where the code originated): @client(Loader)
@resolve("foo", () => load("foo"))
class FooProfile
... |
@ericclemmons for example i was added to stargazers example (react 0.14) some lines:
And as result i dont see loader at page, but i am see I think it is because:
There render method renders loader (state.visible is false). What i am doing wrong? Thanks you for fast reply |
Same problem for me too. The loader isn't displayed. |
Any updates on this? I'm getting the same issue as @EvNaverniouk . Seems like this almost works.
|
Any updates on this? I'm getting the same issue. |
This project is gathering dust. The community is mostly moving over to Redux. I switched over to Redux and am happy with the decision. |
@livemixlove is right. I added @pwmckenna as a contributor since I'm no longer using this project. To be honest, this isn't a hard thing to address or get working. A HoC works pretty well for it (and I have a project in production getting tons of traffic that does just that), but just haven't viewed it. But, I also feel like a dick for being the only one able to resolve this & doing nothing. Going to go ahead & keep this tab open and try to resolve this as soon as I can. For all you Redux users (of which I'm one as well now!), I'm working on a successor to this project that I think is much better architecturally. |
Thanks @ericclemmons and @livemixlove! I was using this decorator for a particular use case (loading documents from https://prismic.io/). I will move that logic in my Redux store. |
This project works best with single-page apps that pretty much fetch data based from the URL (or with a classic Flux implementation), since everything is Promise-based. With Redux or any other single-state library, they don't return promises, so Resolver doesn't really work since it doesn't know when everything's done. |
Sorry to jump in, but since you're discussing Redux, I thought I'd jump in to say that the reason I chose react-resolver, is because I was building a very simple website which needed to fetch some data. I am not using Flux at all. So I was looking for something that could write directly into React state and react-resolver was perfect for that. Migrating to Redux would be a big undertaking and a bit overkill for my needs. I feel like react-resolver is a good fit for such a use-case. |
Then I shall fix it. For you @EvNaverniouk. (Plus, I agree in not adding unnecessary complexity. Redux would make this use-case harder, not easier). |
Ok...
I'm on a plane, which worked really well for updating the React v0.14 demo: And I just confirmed this works with React v0.13 as well! I'll cut a patch release in a bit. Need to merge in |
Whoops! @pwmckenna I'm on a flight right now, so I won't be home for a few hours, so the last remaining items for this PR are:
|
* origin/master: 3.0.1 Adds support for React 15.0.0 (#112) Update README.md removing the react v0.13 example update the changelog with v3.0.0 changesa 3.0.0 fix the postversion npm script Update README.md Update devDependencies Use react-dom
Hmm, so I think we might want two decorators or something, because we need to accommodate:
|
Or maybe we just call this PR good, release it so that there's a proper loading thing via |
Alright, this is out (plus more docs!) as |
I'd love to have a customized way of controlling when components are loading and when they have failed: