You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thanks for this nice lib I did not know.
I was looking for an equivalent of Guava's LoadingCache for a while in js.
Browserify
Notice that your lib works fine in the browser (Browserify) and you can mention that on your readme. However it's better to only load the code we need: var Cache = require("dsjslib/lib/Cache");
Suppliers
Guava support a cache for a single object that would be nice to have in this lib.
See Supplier<Animal> singleAnimalCache = Suppliers.memoizeWithExpiration(animalFromDbSupplier(), 365, TimeUnit.DAYS);
This would remove the burden of managing timers like in this code:
Hi there,
Thanks for your suggestions. Unfortunately I am busy with another project right now and don't have cycles to spend here. Hopefully in some time I can come back to make some improvements.
Thanks
First of all thanks for this nice lib I did not know.
I was looking for an equivalent of Guava's LoadingCache for a while in js.
Browserify
Notice that your lib works fine in the browser (Browserify) and you can mention that on your readme. However it's better to only load the code we need:
var Cache = require("dsjslib/lib/Cache");
Suppliers
Guava support a cache for a single object that would be nice to have in this lib.
See
Supplier<Animal> singleAnimalCache = Suppliers.memoizeWithExpiration(animalFromDbSupplier(), 365, TimeUnit.DAYS);
This would remove the burden of managing timers like in this code:
Support promises
Many of us are currently using promise based libraries like Q and it would be nice to support promises in addition to regular callbacks.
See the boilerplate involded in my example:
I would like to be able to write
Note that my
ApiRequest
here is simply a Q promise factory.I guess you'd rather not introduce dependencies in your lib but maybe this can be put in a separate project or be added as an optional dependency?
The text was updated successfully, but these errors were encountered: