signalpoint / jDrupal

A JavaScript Library and API for Drupal Applications
http://jdrupal.tylerfrankenstein.com/
GNU General Public License v2.0
76 stars 38 forks source link

clearLocalStorage() #32

Closed d0t101101 closed 7 years ago

d0t101101 commented 8 years ago

Please add this custom localcache management function to Jdrupal.

function clearLocalStorage(contains) {
    Object.keys(localStorage) 
        .forEach(function(key){ 
        if ((new RegExp(contains)).test(key)) {
               localStorage.removeItem(key);
           }
        }); 
}
silesky commented 7 years ago

Not sure I get the reasoning here, this looks like a standard utility function? There are many other Javascript libraries that deal with localstorage.

signalpoint commented 7 years ago

@silesky Agreed, thank you. @d0t101101 and I were able to resolve this one on the side some time ago.