v2: feat(Storage): adds setJson() method

This commit is contained in:
Manu Mtz.-Almeida
2016-01-20 14:35:22 +01:00
parent 2f9dd60ada
commit 6da7762139

View File

@@ -29,6 +29,13 @@ export class Storage {
}
});
}
setJson(key: string, value: any): Promise<any> {
try {
return this.set(key, JSON.stringify(value));
} catch (e) {
return Promise.reject(e);
}
}
set(key: string, value: any) {
return this._strategy.set(key, value);
}