Skip to content

Commit

Permalink
馃挜 Default storage type: storageFileAsync -> storageFileSync, see #16
Browse files Browse the repository at this point in the history
  • Loading branch information
TemaSM committed Aug 28, 2018
1 parent cc78100 commit 406fc50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const
* @param {String} [options.property] - Name of property in {@link https://telegraf.js.org/#/?id=context|Telegraf Context} where session object will be located `(default: 'session')`
* @param {Object} [options.state] - Initial state of database. You can use it to pre-init database Arrays/Objects to store your own data `(default: {})`
* @param {Function} [options.getSessionKey] - Function to get identifier for session from {@link https://telegraf.js.org/#/?id=context|Telegraf Context} (may implement it on your own)
* @param {Object} [options.storage] - lowdb storage option for implementing your own storage read/write operations `(default: {@link LocalSession.storageFileAsync|LocalSession.storageFileAsync})`
* @param {Object} [options.storage] - lowdb storage option for implementing your own storage read/write operations `(default: {@link LocalSession.storageFileSync|LocalSession.storageFileSync})`
* @param {Function} [options.storage.read] - lowdb storage read function, must return an object or a Promise
* @param {Function} [options.storage.write] - lowdb storage write function, must return undefined or a Promise
* @param {Object} [options.format] - lowdb storage format option for implementing your own database format for read/write operations
Expand All @@ -24,7 +24,8 @@ const
class LocalSession {
constructor (options = {}) {
this.options = Object.assign({
storage: LocalSession.storageFileAsync,
// TODO: Use storageFileAsync as default with support of Promise or Promise-like initialization, see: https://git.io/fA3ZN
storage: LocalSession.storageFileSync,
database: 'sessions.json',
property: 'session',
state: { },
Expand Down

0 comments on commit 406fc50

Please sign in to comment.