Naughty Programmer's Madness

    alt-resolver

    0.1.0 • Public • Published

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

    Install

    npm i alt-resolver

    DownloadsWeekly Downloads

    0

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • goatslacker