@esfaenza/extensions 11.2.17 → 11.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/esfaenza-extensions.umd.js +9 -7
- package/bundles/esfaenza-extensions.umd.js.map +1 -1
- package/bundles/esfaenza-extensions.umd.min.js +2 -2
- package/bundles/esfaenza-extensions.umd.min.js.map +1 -1
- package/esfaenza-extensions.metadata.json +1 -1
- package/esm2015/lib/services/extensions.storage.service.js +11 -9
- package/fesm2015/esfaenza-extensions.js +10 -8
- package/fesm2015/esfaenza-extensions.js.map +1 -1
- package/lib/services/extensions.storage.service.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1819,6 +1819,9 @@
|
|
|
1819
1819
|
// Angular
|
|
1820
1820
|
/**
|
|
1821
1821
|
* Service che fornisce funzionalità di base per storicizzazione e recupero oggetti dallo Storage Locale
|
|
1822
|
+
*
|
|
1823
|
+
* N.B: In ogni chiamata è presente l'operatore rxjs **first()** per far sì che a prescindere dall'implementazione utente/default gli
|
|
1824
|
+
* observable effettuino l'unsubscribe automaticamente terminata la prima operazine
|
|
1822
1825
|
*/
|
|
1823
1826
|
var StorageService = /** @class */ (function () {
|
|
1824
1827
|
/**
|
|
@@ -1849,10 +1852,9 @@
|
|
|
1849
1852
|
}
|
|
1850
1853
|
else
|
|
1851
1854
|
finalItem = item;
|
|
1852
|
-
return this._storage.setItem(storeName, finalItem).pipe(operators.tap(function (res) {
|
|
1853
|
-
if (res == false)
|
|
1855
|
+
return this._storage.setItem(storeName, finalItem).pipe(operators.first(), operators.tap(function (res) {
|
|
1856
|
+
if (res == false)
|
|
1854
1857
|
console.error("Impossibile effettuare il salvataggio dell'oggetto all'interno dello Storage Locale per la chiave " + storeName);
|
|
1855
|
-
}
|
|
1856
1858
|
}));
|
|
1857
1859
|
};
|
|
1858
1860
|
/**
|
|
@@ -1863,7 +1865,7 @@
|
|
|
1863
1865
|
* @returns {any} Oggetto recuperato e deserializzato
|
|
1864
1866
|
*/
|
|
1865
1867
|
StorageService.prototype.getItem = function (storeName) {
|
|
1866
|
-
return this._storage.getItem(storeName).pipe(operators.tap(function (res) {
|
|
1868
|
+
return this._storage.getItem(storeName).pipe(operators.first(), operators.tap(function (res) {
|
|
1867
1869
|
if (res == null)
|
|
1868
1870
|
console.warn("Impossibile ottenere l'oggetto salvato con chiave " + storeName);
|
|
1869
1871
|
}));
|
|
@@ -1874,7 +1876,7 @@
|
|
|
1874
1876
|
* @param {string} storeName Chiave del localStorage da ripulire
|
|
1875
1877
|
*/
|
|
1876
1878
|
StorageService.prototype.removeItem = function (storeName) {
|
|
1877
|
-
return this._storage.removeItem(storeName).pipe(operators.tap(function (res) {
|
|
1879
|
+
return this._storage.removeItem(storeName).pipe(operators.first(), operators.tap(function (res) {
|
|
1878
1880
|
if (res == false)
|
|
1879
1881
|
console.warn("Impossibile rimuovere l'oggetto salvato con chiave " + storeName);
|
|
1880
1882
|
}));
|
|
@@ -1885,7 +1887,7 @@
|
|
|
1885
1887
|
* @param {string} storeName Chiave del localStorage da ripulire
|
|
1886
1888
|
*/
|
|
1887
1889
|
StorageService.prototype.clear = function () {
|
|
1888
|
-
return this._storage.clear().pipe(operators.tap(function (res) {
|
|
1890
|
+
return this._storage.clear().pipe(operators.first(), operators.tap(function (res) {
|
|
1889
1891
|
if (res == false)
|
|
1890
1892
|
console.warn("Impossibile ripulire lo Storage Locale");
|
|
1891
1893
|
}));
|
|
@@ -1896,7 +1898,7 @@
|
|
|
1896
1898
|
* @returns {Observable<{ [index: string]: string; }>} Risultato della query
|
|
1897
1899
|
*/
|
|
1898
1900
|
StorageService.prototype.getAll = function () {
|
|
1899
|
-
return this._storage.getAll();
|
|
1901
|
+
return this._storage.getAll().pipe(operators.first());
|
|
1900
1902
|
};
|
|
1901
1903
|
return StorageService;
|
|
1902
1904
|
}());
|