-
Notifications
You must be signed in to change notification settings - Fork 13
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
multiple redux spinners #24
Comments
I'm sorry for taking ages to reply to this. I must've missed it when you made it and haven't checked back since. Yes, that should be feasible. The reducer is already configurable so we could have multiple reducers at separate paths. We'd need to do something with the actions (since they only act on a specific key) and make them configurable too. Then we'll make the component configurable too, essentially telling it which part of the redux state to look at. Is this something still interesting, or have you moved on to other things? |
I think this may be related to my request/issue @noseglid @mstruensee :-) |
I actually forgot about this since I switched teams, but yes, I would still like to get this working! I will give this a go again with new information. Any additional info would be greatly appreciated. Thanks. |
Hi Thanks for the reply! |
I get the concept of configurablePendingReducer ... how do I add multiple throughout the app and have the correct to the correct reducer (key) ? Per original comment, example is a app level across the entire page, and then one inside a . So have 100 cards, each have their own, and the app level one is done with all 100 cards are done .... i think we need this to be configurable in spinner.js ... then I think it should pan out ...
|
You're onto it there. I think these things must be done;
I think the difficult thing here is to synchronize the reducer, action and the component. What should that property the component gets look like? Ideally we'd want the library to expose something which generates this in a deterministic way. |
Would we need to change anything except having the option of setting the reducer name? inside ur action just put your name ? everything still can flow like normal, with the key option, the task count, etc ... because they are checking the task count for that specific reducer ... I will have to do some testing. |
I see what you're referring to, it is not just a simple change in 1 spot lol ... |
No I think it requires a simple change in 3 spots :) Let me know if you're giving this a stab, otherwise I'll see if I can get some time to get this done. |
I tried that and I didn't get the result I was expecting, still testing ... |
NProgress puts the div on the tree using id="nprogress" .. I think this is preventing me from having 2 on the same page. |
here is a fork for nprogress which they made for multi ... there is an issue though, with having one inside another, I commented, hopefully they can fix it. If/once fixed ... you can use that. I forked yours and have it done (I copied the nprogress.js file and committed it), but I still need to attach the reducer name to the config. Will try that some tomorrow if I have time. |
Oh yeah, that's gonna be an issue. At some point I've been thinking about rolling our own progress bar so we can scrap the dependency of I'm not sure I'm comfortable changing the dependency to |
I was thinking the same thing, My fork has the nprogress multi piece working .. you want to check that out? lmk what you think/plans, I can help if needed ... |
I have a hacked version working ... but I do not like it ... I envision something like this ...
the only possible idea I have is to curry the actionKey ... something like
But the problem is typing the reducer name in combineReducers to the action type ([pendingTask], [anotherTask]) ... naming the reducer pendingTask it gives the illusion that [pendingTask] is somehow linking to it (with the names) but its not in reality... as the reducer name is pendingTask and [pendingTask] is "@@react-redux-spinner/pending-task" ... Not sure how to make it dynamic where the evaluated [anotherTask] points to anotherTask reducer ... ideas? see here for working example To me, what I want is too specific for dynamic/configurability ... |
what are your thoughts? |
If we're doing something like Hmm, What if we provided an array to the configurablePendingTasksReducer which all the strings it should listen to, and it would keep one integer in its state for each of them. Then the component would need to be configured with which key to display. Lastly, the reducer would need to iterate all the keys it was configured with, and increase the right key in the state. Drawback is that this is potentially a breaking change since the In regards to the multi-nprogress and it putting an |
i was thinking the same about an array ... let me give that a try and see if i like that better ... |
Is there any way to have multiple instance of this by using the curry design? or any design?
What I am trying to do is, basically have a bar per bootstrap card, vs 1 bar across the entire page. I want to have the ability to start n stop each one individually based on that reducer, etc...
Is this at all possible with the current design?
The text was updated successfully, but these errors were encountered: