Comments (6)
hi @kjanoudi
Could you please describe more detailed your case?
There is no such api to reload promises in asyncConnect decorator now
However changing location would reload them
from redux-async-connect.
Hi @sars,
As to this topic, what would it take to expose that kind of API? I think it would expand the usability of the asyncConnect package exponentially if we can allow reloading of the data without a location/route change.
Also, unrelated but I'm not sure if you saw my post here, that may help me understand better:
erikras/react-redux-universal-hot-example#928 (comment)
from redux-async-connect.
@kjanoudi ,
what interface would you expect for such API?
there is loadOnServer method that triggers loading
do you want to trigger just reloading of current route?
or you want to trigger it for specific route?
from redux-async-connect.
@sars Is the loadOnServer method able to be called from the client side? I was unclear, based on it's usage within the node.js code in the example, as well as the function name.
given this example:
@asyncConnect([{
key: 'widgets',
promise: ({helpers}) => helpers.client.get('/widget/load/param1/param2')
}])
It would be nice to be able to do something like pass in a dispatch method that would allow us to reload a prop based on it's key. Something like
import { loadAsync } from 'redux-async-connect';
handleClick(){
loadAsync('widgets')
}
Is that feasible?
from redux-async-connect.
@kjanoudi the problem is that key is global now. This means that you can use asyncConnect for different components with same keys.
what promise in your case loadAsync('widgets')
it should invoke? ...
I thought... may be it make sense to define keys and promises for them in one place, like..
reduxAsyncConnect.init({
widgets: ({helpers}) => helpers.client.get('/widget/load/param1/param2')
})
or something like this... and then use them in components, like:
@asyncConnect([{
key: 'widgets',
deferred: true,
shouldUpdate: ...
}])
in this case function loadAsync('widgets') would definitely make sense..
from redux-async-connect.
@sars I was running under the impression that the keys would be/are unique. In that sense, a single key would always map to a single route/action.
from redux-async-connect.
Related Issues (20)
- How to perform a synchronous call?
- How to access props in reduxAsyncConnect function? HOT 2
- No documentation for loadOnServer
- loadOnServer is not in sync with AsyncConnect HOT 1
- How to sync @asyncConnect with loadOnServer
- asyncConnect doesn't block mounting when programmatically navigating
- How can I use it with immutablejs? HOT 2
- Accessing PropTypes via the main React package is deprecated.
- The sample client code in usage doesn't work. HOT 2
- Cannot find module 'react-router/lib/RouterContext' HOT 3
- npm Warning requires [email protected] HOT 2
- How can I use it with react-router v4? HOT 3
- use react@16 ??? HOT 1
- How to use with code splitting / loadable-components
- Load empty block by server side rendering HOT 1
- Support react-v15.2.x
- upgrade needed to react "react": "^15.2.1", HOT 1
- first entry page miss render
- How loadOnServer works? HOT 1
- Help needed: dipatch, getState not being made available to action creators
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 redux-async-connect.