Context Module Function, solution
Our assignment was to take the
handleSubmit function logic and move it to a Context Module Function.
- Cut the logic from
- Create a new function, named
- Paste the function implementation.
With this new function, we need to identify all of the missing dependencies and take them as functions arguments.
- First is
userDispatch, which we’ll take as
- Then take a
- And finally, the
updates(or changes) we intend to make.
Then we need to return this promise — so future consumers can continue the promise chain (with additional functionality).
- Then remove this
userDispatchnaming dependency by taking
dispatchas an argument.
- Note that we have red squiggles because
- map internal values to function arguments