+
Skip to content

ghsamm/bookstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this ?

Just a small project to demonstrate my coding style.

One-click demo

https://codesandbox.io/s/gallant-proskuriakova-r2y9w

What is there to see ?

  • Typescript everywhere, because it enables:
    • a better dev experience
    • less run-time bugs
    • better code quality
  • This cool utility function: src/style/fromTheme.ts
    • that not only is it type-safe
    • but also uses a handy FP concept called currying
    • well, one thing helped with the other 😆
  • This custom hook src/hooks/useRequest.ts that is:
    • also cool
    • but more importantly type-safe, thanks to TS generics
    • and enables manual refetching of data!
  • styled-components because :
    • it enables seamless integration between the programming(JS/TS) world and the styling (CSS) world
    • supports theming: check out the theme here src/style/theme.ts
  • This obscure naming pattern that I found very useful: read the article
  • An example of a snapshot test: src/components/BookCard/BookCard.test.tsx
  • An example of a unit test for the useRequest custom hook: src/hooks/useRequest.test.ts
  • Routing with react-router
  • Data fetching that is, you guessed it, type-safe 😑: src/services/getBooks.ts
  • The file structure, pretty easy to move around
  • The commit messages, one thing at a time 😉

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载