lscache
lscache copied to clipboard
No resetBucket() method listed in the README
I notice that there is a resetBucket() method, but the README doesn't discuss it. Can this be added? On a related note, the README says the API exposes 5 methods, but it's actually 7 if you include the two bucket methods.
Sure, can you send a pull request? I don't actually use lscache in any of my projects these days, so I haven't had an excuse to actively work on it. Thus, I love pull requests like that! :)
Ok, I'll see what I can do. Thanks.
A question, according to your note,
lscache.set('response', '...', 2);
lscache.setBucket('lib');
lscache.set('path', '...', 2);
lscache.flush();
then is everything after setBucket using 'lib'?
also, in your example
function initBuckets() {
var bucket1 = [];
for (var i = 0; i < CARDS_DATA.length; i++) {
var datum = CARDS_DATA[i];
bucket1.push({'id': datum.id, 'lastAsked': 0});
}
lscache.set(LS_BUCKET + 1, bucket1);
lscache.set(LS_BUCKET + 2, []);
lscache.set(LS_BUCKET + 3, []);
lscache.set(LS_BUCKET + 4, []);
lscache.set(LS_BUCKET + 5, []);
lscache.set(LS_INIT, 'true')
}
is it good practice or unnecessary to use lscache.setBucket("something") ?