We want to get/have access to all values stored in browser storage.
Implement (complete) the hook below such that it meets the acceptance criteria.
We want to have the ability to read, add and update values from the browser storage when the hook is called.
Think about all the CRUD actions for each object returned from the useBrowserStorage()
hook.
- for. v1 can be as poor as possible because we shall review and work on refactoring
- v2 consider better state management ( context, stateHooks, reducers )
- v3 consider performance improvements ( caching, memoizing etc.)
const useBrowserStorage = () => {
// .....CODE TO Support the return values ... //
// each of these should have setter and getter methods
// setter sets new/updated information
// get gets saved information
return {
localStorage: {},
sessionStorage: {},
cookies: {}
}
}
const { localStorage, sessionStorage, cookies } = useBrowserStorage();
localStorage.get("KEY");
localStorage.set("key", "newValue")
const localStore = localStorage.get("KEY")
//..... same for sessions and cookies ....
- Create a new repo and add me as a collaborator
- For every object returned from the hook, create a branch (conventional commits)[https://www.conventionalcommits.org/en/v1.0.0/]
- Open a PR for each branch and add me (@claeusdev) to the reviewers.