Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initStateStore - Don't Assume LocalStorage #243

Open
dOrgJelli opened this issue Nov 17, 2019 · 0 comments
Open

initStateStore - Don't Assume LocalStorage #243

dOrgJelli opened this issue Nov 17, 2019 · 0 comments
Labels
code improvement Suggest a code improvement. good first issue Good for newcomers Lib med pri
Milestone

Comments

@dOrgJelli
Copy link
Member

Currently we've hard-coded our state persistence into the UI layer and are using the localStorage of the browser. We should instead be making API calls into the Lib layer, and using an interface the implementer of the library supplies upon initialization.

For example:

import { initStateStore } from "lib/state";

// localStorage in browser, file in CLI
setStateStore({
  getItem: (key: string) => { ... },
  setItem: (key: string, value: string) => { ... },
  clearItem: (key: string) => { ... }
});

// later in the application
getSavedDAO();
saveDAO(dao);
@dOrgJelli dOrgJelli added good first issue Good for newcomers code improvement Suggest a code improvement. med pri V1 Lib labels Nov 17, 2019
@dOrgJelli dOrgJelli added this to the V1.1 milestone Nov 17, 2019
@nickplace nickplace self-assigned this Nov 18, 2019
@dOrgJelli dOrgJelli modified the milestones: V1.1, V2 Mar 9, 2020
@dOrgJelli dOrgJelli removed the V1 label Mar 9, 2020
@dOrgJelli dOrgJelli changed the title initStateStore - Don't Assume LocalStorage Lib: initStateStore - Don't Assume LocalStorage Mar 9, 2020
@dOrgJelli dOrgJelli changed the title Lib: initStateStore - Don't Assume LocalStorage initStateStore - Don't Assume LocalStorage Mar 9, 2020
@nickplace nickplace removed their assignment Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code improvement Suggest a code improvement. good first issue Good for newcomers Lib med pri
Projects
None yet
Development

No branches or pull requests

2 participants