How to use the react-simple-di.useDeps function in react-simple-di

To help you get started, we’ve selected a few react-simple-di 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
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 / maodou / events / client / containers / event.js View on Github external
}
    } 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
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
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);
github maodouio / meteor-react-redux-base / maodou / usersManage / client / containers / memberInfo.js View on Github external
loggedIn: !!user,
      isMember,
      isApplying
    });
  } else {
    onData(null, { loggedIn: user});
  }
};

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

export default composeAll(
  withTracker(initData),
  useDeps(depsToProps)
)(MemberInfo);
github maodouio / meteor-react-redux-base / client / containers / users / login.js View on Github external
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);

react-simple-di

Simple Dependancy Injection Solution for React

MIT
Latest version published 9 years ago

Package Health Score

48 / 100
Full package analysis

Popular react-simple-di functions

Similar packages