woltapp / redux-autoloader Goto Github PK
View Code? Open in Web Editor NEWA higher order component for declarative data loading in React and Redux.
License: MIT License
A higher order component for declarative data loading in React and Redux.
License: MIT License
Hi,
we rely heavily on redux-autoloader in our latest project to fetch all data necessary. We would like to implement a "Refresh" button for the user (because otherwise users tend to hit F5 when they see no such button).
However, since we have a lot of data, we have lots of data and they are parametrized by ids (thousands of api endpoint in total), we cannot simple call .refresh() per component. So we would like to have a .refreshAll() method somewhere.
We tried dispatching a reset/load action, but reducer/saga depends on getting the apiCall as payload, which we cannot pass when api calls are parametrized.
Is there a possibility this package might include an internal memory of all instances to expore a refreshAll method? Maybe like a second HOC to wrap the refresh button in.
Hello again,
we are currently using RC-9 in production and upon trying RC-11, we have found a regression bug. It might not really be a bug, since you said that RC-10:
fixed incorrect behavior when loader has been initialized and reloadOnMount=false
We have a following setup with reloadOnMount false because we have multiple independent components using the same loader:
{
reloadOnMount: false,
cacheExpiresIn: 15e3,
autoRefreshInterval: 60e3
}
When using the default of true, two component in the same loader triggered two identical network requests and a lot of other requests on component updates.
The change in RC-10 is that the apiCall is not triggered on first mount at all (I expected it would, because loadOnInitialize is still true), but it doesn't. It only triggers API for the first time after 60 seconds (the first refresh interval).
Is that expected or are we just using it wrong?
I can't figure out a way to implement the following use case with redux-autoloader:
There's a reduxAutoloader
wrapped component with auto-refresh enabled and it's utilising the refresh
prop. The wrapped component should render loading spinner when the data is being reloaded as result of refresh
prop but should not render the spinner when the data is loading as result of auto-refresh interval.
I can't figure out how the wrapped component could separate the two cases when looking at the props redux-autoloader is passing.
I also think the terms refresh and auto-refresh are mixed in the documentation which causes confusion. For instance, I incorrectly thought isRefreshing
means someone has called refresh
and the data is now being refreshed because of that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.