Category: Code

Redux Cycle

Action Creator (User)-> Action(Form) -> dispatch(Form handler) -> Reducers(Departments) -> State(Compiled shared department data) Analogy, Insurance Company: policy: Customer holds a policy, if bad stuff happens to them then we pay them claim: Customer had something bad happen to them, we need to pay them. Customer signs up for a Policy -> Form -> Form …

Custom Hooks

Custom hooks are a great way to avoid repeating yourself while writing code. Custom hooks will always use a primitive React hook. Its not for JSX. Each hook should have only one purpose, such as data-fetching from a specific api. Steps to take when creating reusable hooks Identify each line of code related to some …