Skip to content

altjs/resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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,
    }
  },
})

About

A connect to stores that works with react-resolver

Resources

Stars

Watchers

Forks

Packages

No packages published