Coder Social home page Coder Social logo

Comments (4)

angelnikolov avatar angelnikolov commented on September 26, 2024 1

First of all - thanks for the well described question and the stackblitz you've put together.
It sounds like what you are looking for is maxCacheCount which will allow you to specify how many invocations should be cached per method. That means that calling your method with 1 and 2 will both be cached if you specify a maxCacheCount of 2 or more.
Also, from a couple of weeks ago, you can also specify that configuration globally (check out the README).
There have also been talks about adding a keepAlive option to each decorator or globally which will basically make the decorators cache indefinitely, but I haven't reached it yet.
If you got any other questions, please let me know. :)

from ts-cacheable.

jaydiablo avatar jaydiablo commented on September 26, 2024

I see, does maxCacheCount default to 1 then?

I updated my stackblitz to bump that to 3 and it does seem like it does what I want now. Thanks!

Maybe something that could be added to the readme (the default of maxCacheCount).

from ts-cacheable.

angelnikolov avatar angelnikolov commented on September 26, 2024

Yes, it actually doesn't have a default, but if it's not set it will indeed act as 1, so I will update the Readme :) Thanks!

from ts-cacheable.

jaydiablo avatar jaydiablo commented on September 26, 2024

Thanks!

from ts-cacheable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.