general-store icon indicating copy to clipboard operation
general-store copied to clipboard

use lazy state initialization to avoid eager deref calculation

Open aem opened this issue 4 years ago • 0 comments

h/t @gmcnaughton for pointing out that we can optimize this hook with a lazy state init to avoid double-calculating the deref on every render, which can be meaningful for expensive derefs

TODOs

  • [x] linter, checker, and test are passing
  • [ ] any new public modules are exported from src/GeneralStore.js
  • [ ] version numbers are up to date in package.json
  • [ ] CHANGELOG.md is up to date

aem avatar Feb 18 '21 20:02 aem