Skip to content

Commit

Permalink
docs: default data required (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
CalHoll authored May 19, 2023
1 parent f58dfab commit 4aa1425
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ type Data = {

const defaultData: Data = { messages: [] }
const adapter = new JSONFile<Data>('db.json')
const db = new Low<Data>(adapter)
const db = new Low<Data>(adapter, defaultData)

db.data.messages.push('foo') // ✅ Success
db.data.messages.push(1) // ❌ TypeScript error
Expand Down

0 comments on commit 4aa1425

Please sign in to comment.