Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.17 KB

README.md

File metadata and controls

37 lines (27 loc) · 1.17 KB

Hooks

This directory contains all re-usable custom React Hooks implemented for use across this UI. Unlike Models, these hooks encapsulate re-usable/common logic views or models may want to utilise, such as translation capabilities.

Test approach

Elements should be tested in a functional manor. See Test Driven Development.

Expected files

For a given Hook useFoo, the expected files are as follows:

Hooks/
  index.ts
  types.ts
  useFoo/
    README.md
    useFoo.ts
    useFoo.spec.ts
    useFoo.assets.ts
    useFoo.types.ts

Where:

  • index.ts acts as a barrel file, exporting the hooks defined in the Hooks directory
  • types.ts acts as a barrel file, exporting all the public types of each context
  • README.md is the readme for this hook, detailing design choices and usage
  • useFoo.ts is the hook implementation
  • useFoo.spec.ts are the tests for this hook
  • useFoo.assets.ts are the test assets for this hook
  • useFoo.types.ts are the types for this hook

Implemented hooks

Hooks to be added here on implementation, with summary of purpose/usage and a link to it's README.