Created
September 8, 2020 10:20
-
-
Save b4n92uid/ba564005ccd453ea17fa42248c0eb43b to your computer and use it in GitHub Desktop.
LowDB Storage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import low from "lowdb"; | |
import LocalStorage from "lowdb/adapters/LocalStorage"; | |
const adapter = new LocalStorage("app-settings"); | |
const storage = low(adapter); | |
storage | |
.defaultsDeep({ | |
session: { | |
user: null, | |
token: null | |
} | |
}) | |
.write(); | |
export default storage; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment