Design for Notify Hook
In this lesson, explore how to design the Notify hook and how it will interact with other components.
Some background on what we are building
For the purpose of this exercise, assume you are building a Notify hook to show notifications when a user submits any form. We will focus on this use case for the design and coding for the Notify hook.
It will be easier to understand the logical flow of the application by building a sequence diagram. Later, you will decide which part of this design can be abstracted away in a custom hook.
Shape of Notify state
We will be saving the current state for the notification as seen below. The state shape is straightforward. Store the notification ...