haversack

Easy save state management using browser localStorage or sessionStorage and React Hooks.

MIT License

Downloads
15
Stars
1
Committers
3
haversack - 1.3.0 Latest Release

Published by colinhemphill about 1 year ago

[1.3.0] - 2023-09-07

Changed

  • Dependency updates
  • Change to PNPM for dependencies
  • Build to ESM and CJS
  • Improved dev tooling and config
haversack - 1.2.3

Published by colinhemphill about 1 year ago

[1.2.3] - 2022-06-11

Changed

  • Dependency updates
haversack - 1.2.2

Published by colinhemphill about 1 year ago

[1.2.2] - 2022-05-11

Changed

  • Update all dependencies
  • Build system now using tsup
  • Fixed up the project structure a bit
haversack - 1.2.1

Published by colinhemphill about 3 years ago

[1.2.1] - 2021-09-29

Added

  • New tests for SSR behavior
  • New tests for versioning
  • The version can now be a string in addition to a number
    • This is especially useful if you want to hash a data set to invalidate the cache dynamically

Changed

  • Dependency updates
haversack - 1.2.0

Published by colinhemphill about 3 years ago

Added

  • Add a version param which allows you to invalidate the stored values who were using a different version

Changed

  • Dependency updates
    • Upgraded to the latest husky which uses git hooks instead of config in the package.json file
    • Added React 17.x to valid peerDependencies
  • Added eslint-plugin-react-hooks and updated the plugin bassed on recommendations
    • useEffect and useState within the hook are not conditional based on isServerSide()
  • Changed from a window.onstorage function to window.addEventListener
    • Setup is done in a useEffect hook that removes the listener on unmount

Fixed

  • This likely fixes some potential memory leaks from storage listeners and functions returned from the hook
haversack - 1.1.0

Published by colinhemphill about 4 years ago

Added

  • Add onstorage event handler to sync state changes between browser tabs

Changed

  • Update documentation to list bundle size
haversack - 1.0.0

Published by colinhemphill about 4 years ago

Added

  • Two exported React hooks: useLocalStorage and useSessionStorage
  • TypeScript typings
  • Jest and Testing Library test suite

Changed

  • Completely rewritten and repurposed
  • This is essentially a brand new library
  • Documentation fully updated
Package Rankings
Top 13.88% on Npmjs.org
Badges
Extracted from project README
NPM version NPM downloads MIT License