brocoders / redux-async-connect

It allows you to request async data, store them in redux state and connect them to your react component.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

this.props.lunch example is populated async object

blainegarrett opened this issue · comments

In the example decorator
@asyncConnect({ lunch: (params, helpers) => Promise.resolve({id: 1, name: 'Borsch'}) })
the decorated component has this.props.lunch available with a value of {id: 1, name: 'Borsch'}
such that you can do this.props.lunch.name.

However, for me this.props.lunch has a value of { loading: false, loaded: true, data: { id: 1, name: 'Borsch' } } such that to access the name I need to do this.props.lunch.data.name

I feel like there is a missing then() from the example? Any tips to debug?

@blainegarrett in newer version (1.0.x) it works as you expect..