feat(storage): new Local and WebSQL/SQLite key value storage service

This commit is contained in:
Max Lynch
2015-09-03 23:16:50 -05:00
parent c32eedde76
commit ee2486b76a
6 changed files with 259 additions and 0 deletions

30
ionic/storage/storage.ts Normal file
View File

@ -0,0 +1,30 @@
/**
* Storage is an easy way to store key/value pairs and other complicated
* data in a way that uses the best possible storage layer underneath.
*/
export class Storage {
constructor(strategyCls: StorageStrategy) {
this._strategy = new strategyCls();
}
get(key) {
return this._strategy.get(key);
}
set(key, value) {
return this._strategy.set(key, value);
}
remove(key) {
return this._strategy.remove(key);
}
}
export class StorageStrategy {
get(key, value) {
throw Error("Not implemented");
}
set(key, value) {
throw Error("Not implemented");
}
remove(key) {
throw Error("Not implemented");
}
}