redux-async-connect
redux-async-connect copied to clipboard
Update the readme and API ?
trafficstars
It seems the example in readme.md is not working in v1.0.0-rc2, it's very confusing and I don't know how to use this in the right way. :cry:
Uncaught TypeError: asyncItems.map is not a function
function wrapWithDispatch(asyncItems) {
return asyncItems.map(function (item) {
...
It seems it should be an array? But in the example:
@asyncConnect({
lunch: (params, helpers) => Promise.resolve({id: 1, name: 'Borsch'})
})
I don't know how to do next...
I've just stumbled upon this as well... It seems that with the new API the example should be rewritten like this:
@asyncConnect([{
key: 'lunch',
promise: (params, helpers) => Promise.resolve({id: 1, name: 'Borsch'})
}])
In short - instead of an object, you should pass an array of objects, each having 2 fields - 'key' and 'promise'.