Skip to content

Commit

Permalink
Update README with better formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
whitfin committed Nov 14, 2023
1 parent 6e94a00 commit 82e45bf
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ const TitaniumAdapter = require('loki-titanium-adapter');

// Construct our database instance
const db = new Loki('my-database', {
adapter: new TitaniumAdapter({
parent: 'data', // subdirectory in app data
reader: {
buffer: 1024 * 1024 // max buffer during disk reads
},
writer: {
batch: 25 // number of documents to write in batch
}
}),
autoload: true,
autosave: true,
autosaveInterval: 5000,
autoloadCallback: function () {
// called when your database is loaded
},
adapter: new TitaniumAdapter({
parent: 'data', // subdirectory in app data
reader: {
buffer: 1024 * 1024 // max buffer during disk reads
},
writer: {
batch: 25 // number of documents to write in batch
}
}),
autoload: true,
autosave: true,
autosaveInterval: 5000,
autoloadCallback: function () {
// called when your database is loaded
},
});
```

Expand All @@ -53,9 +53,9 @@ hook for the `pause` event to flush when the application is closed:
```javascript
// Add a pause listener to ensure flush on background
Ti.App.addEventListener('pause', function (_e) {
db.saveDatabase(function (e) {
// documents should have been flushed
});
db.saveDatabase(function (e) {
// documents should have been flushed
});
});
```

Expand Down

0 comments on commit 82e45bf

Please sign in to comment.