lockr icon indicating copy to clipboard operation
lockr copied to clipboard

Shouldn't flush() remove only prefixed keys?

Open Knagis opened this issue 9 years ago • 6 comments
trafficstars

getAll() returns only the prefixed keys, shouldn't flush() remove only those as well?

Knagis avatar Feb 26 '16 11:02 Knagis

Would it be useful to have both behaviours?

tsironis avatar Feb 26 '16 11:02 tsironis

perhaps ignorePrefix (boolean) argument could be added both to getAll() and flush(). Or perhaps options with noPrefix field.

Knagis avatar Feb 26 '16 11:02 Knagis

@eavgerinos what do you think?

tsironis avatar Feb 26 '16 14:02 tsironis

@Knagis @tsironis You are right. flush should, by default, purge only lockr keys.

avgerin0s avatar Feb 27 '16 11:02 avgerin0s

@Knagis @eavgerinos Take a look at this one guys.

tsironis avatar Feb 29 '16 09:02 tsironis

Completely agreed. If I want to delete all the local storage I'd rather do localStorage.clear(); (rather than using a wrapped method that just does that).

ibc avatar Dec 06 '17 22:12 ibc