How to use the react-komposer-plus.composeAll function in react-komposer-plus

To help you get started, we’ve selected a few react-komposer-plus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github maodouio / meteor-react-redux-base / maodou / counter / client / containers / counter.js View on Github external
context,

  onIncrement() {
    context.dispatch(actions.counter.increment());
  },

  onReset() {
    context.dispatch(actions.counter.reset());
  },

  onRandom() {
    context.dispatch(actions.counter.random());
  }
});

export default composeAll(
  withRedux(mapStateToProps),
  useDeps(depsToProps)
)(Counter);
github maodouio / meteor-react-redux-base / client / containers / users / login.js View on Github external
const isWechat = user.profile.headimgurl || user.city;
    const nickname = user.profile.nickname;
    const avatar = isWechat ? user.profile.headimgurl : '';
    onData(null, {
      loggedIn: !!user,
      notWechat: !isWechat,
      isWechatVerified,
      nickname,
      avatar
    });
  } else {
    onData(null, {loggedIn: user});
  }
}

export default composeAll(
  withTracker(composer),
  useDeps()
)(Login);
github maodouio / meteor-react-redux-base / maodou / events / client / containers / event.js View on Github external
toastr.error("活动没有找到,返回到原来页面");
        browserHistory.push('/events');
      }
    } else {
      document.title = event.title;
      onData(null, { event });
    }
  });
  onData(null, {});
};

const depsToProps = (context, actions) => ({
  context
});

export default composeAll(
  compose(initData),
  useDeps(depsToProps)
)(Post);
github maodouio / meteor-react-redux-base / maodou / events / client / containers / admin / eventsList.js View on Github external
const events = Collections.Events.find().fetch();
    onData(null, {
      events: { status: 'ready', data: events }
    });
  } else {
    onData(null, {
      events: { status: 'pending', data: [] }
    });
  }
};

const depsToProps = (context, actions) => ({
  context
});

export default composeAll(
  withTracker(subscription),
  useDeps(depsToProps)
)(EventsList);
github maodouio / meteor-react-redux-base / client / containers / users / register.js View on Github external
import Register from '../../components/users/register';

function composer({context}, onData) {
  onData(null, {
    loggedIn: !!context.Meteor.user()
  });
}

const depsToProps = (context, actions) => ({
  context,
  dispatch: context.dispatch,
  createNewUser: actions.users.createNewUser,
});

export default composeAll(
  withTracker(composer),
  useDeps(depsToProps)
)(Register);

react-komposer-plus

Compose React containers and feed data into components.

MIT
Latest version published 8 years ago

Package Health Score

42 / 100
Full package analysis

Popular react-komposer-plus functions

Similar packages