Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Composing @Nexus.component
@component(() => ({
users: ['remote://users', {}],
}))
@component(({ users }) =>
users.mapKeys((userId) =>
[`user:${userId}`, [`remote://users/${userId}`, { firstName: 'John', lastName: 'Doe' }]]
).toObject()
)
class UserList extends React.Component {
render() {
return _(this.props)
.filter((v, k) => k.startsWith('user:'))
.map((user) => <UserItem {...user} />)
.value();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment