alt-resolver
v0.1.0
Published
A connect to stores that works with react resolver
Downloads
4
Maintainers
Readme
alt-resolver
A connect to stores that works with react-resolver
Example
import { resolver } from 'alt-resolver'
import React from 'react'
import UserStore from '../stores/UserStore'
class MyComponent extends React.Component {
render() {
return <div>Hello, {this.props.userName}!</div>
}
}
resolver(MyComponent, {
listenTo() {
return [UserStore]
},
resolve() {
return {
user: Promise.resolve({ name: 'Jane' }),
}
},
getProps(props) {
return {
userName: props.name,
}
},
})