Created
February 17, 2019 00:23
-
-
Save malerba118/a05777cb4c49d37d8b6e4953f6be43d7 to your computer and use it in GitHub Desktop.
Creating the Database
This file contains 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 { schema } from "normalizr"; | |
import createDB from "react-use-database"; | |
let TodoSchema = new schema.Entity("Todo"); | |
let models = [TodoSchema]; | |
let [ DatabaseProvider, useDB ] = createDB( | |
models, | |
{ | |
storedQueryDefinitions: { | |
ALL_TODOS: { | |
schema: [TodoSchema], | |
defaultValue: [] | |
}, | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment