Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

needs better docs, examples #7

Open
DanielFGray opened this issue Aug 3, 2017 · 1 comment
Open

needs better docs, examples #7

DanielFGray opened this issue Aug 3, 2017 · 1 comment

Comments

@DanielFGray
Copy link

For instance, how do you actually use the lifecycle composables?

@smeijer
Copy link

smeijer commented Sep 20, 2017

And a basic react-redux example. As I see it, the connect can not life within the assemble HOC?

Cross post from #4:


This doesn't work for example:

assemble(
  connect(), // react-redux/connect
  withHandlers({
    requestSubmit: ({ form, dispatch }) => () => {
      dispatch(submit(form)); // ERR: dispatch is `undefined`
    },
  }),
),

The correct working way would be:

compose(     // recompose/compose
  connect(), // react-redux/connect
  assemble(  // reassemble/assemble
    withHandlers({
      requestSubmit: ({ form, dispatch }) => () => {
        dispatch(submit(form));
      },
    }),
  ),
);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants