Skip to content

Frontend PR

juliencrn/usehooks ternary dark mode#

  • @2022-01-25
  • juliencrn/usehooks-ts#89
  • Don't do unnecessary design like forcing a enum when not needed. The string type is needed anyway.
  • Do not mix functionalities that increases cohesion. A function for a functionality is fine.
  • User may have more use cases than original design. Should expose as more interfaces as possible.
  • Variable name can be short. Prioritize more on readability if no possible confusion.
  • When use public space like window, document, localStorage, the naming should contain some package-wise unique identifier. From gist
  • Anonymous functions in return value will "create memory leak because they cannot be collected by the garbage collector." From @juliencrn's advice
  • Bonus: not introduce breaking changes for the current users. Reason