Skip to content
Permalink
Browse files

feat(Storage): expose the name of the used driver

  • Loading branch information...
NoNameProvided committed Jan 4, 2017
1 parent 78b9ee1 commit 6daefa3bf5845b05e7c3fcfa39166566aae44c5c
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/storage.ts
@@ -99,6 +99,7 @@ import CordovaSQLiteDriver from 'localforage-cordovasqlitedriver';
@Injectable()
export class Storage {
private _dbPromise: Promise<LocalForage>;
private _driver: string = null;

/**
* Create a new Storage instance using the order of drivers and any additional config
@@ -129,12 +130,21 @@ export class Storage {
.then(() => db.setDriver(this._getDriverOrder(driverOrder)))
.then(() => {
console.info('Ionic Storage driver:', db.driver());
this._driver = db.driver();
resolve(db);
})
.catch(reason => reject(reason));
});
}

/**
* Get the name of the driver being used.
* @return Name of the driver
*/
get driver() {
return this._driver;
}

ready() {
return this._dbPromise;
}

0 comments on commit 6daefa3

Please sign in to comment.
You can’t perform that action at this time.