Giter Club home page Giter Club logo

Comments (2)

anywhichway avatar anywhichway commented on August 27, 2024

@outlawpractice Sorry for the delay. In a Forest Gump kind of moment, I simply stopped writing code late December. I used to write code at least 2 hours every day as a hobby. Here is some guidance:

  1. Add a property "deps" to the argument "o", see line 28
function nanomemoize(fn,o) {
		/*o = {
			serializer, // used to serialize arguments of single argument functions, multis are not serialized
			equals, // equality tester, will force use of slower multiarg approach even for single arg functions
			maxAge, // max cache age is ms, set > 0 && < Infinity if you want automatic clearing
			maxArgs, // max args to use for signature
			vargs = vrgs(fn) // set to true if function may have variable or beyond-signature arguments, default is best attempt at infering
		  } = {}
		*/
  1. Modify the returned functions at line 59 and 74 something like this
const depchange = o.deps.filter(t => t.id === someId);

line 64 for single arg

return (!depchange && wm.get(a)) || ((!c||c(a,wm)),wm.set(a,r = fn.call(this, a)),r);

line 67 for single arg:

``
return (s[key] && !depchange) || ((!c||c(key,s)),s[key] = fn.call(this, a));


line 76 for multi arg

for(i=k.length-1;!depchange && i>=0;i--)


Let me know how it goes

from nano-memoize.

anywhichway avatar anywhichway commented on August 27, 2024

closing for lack of activity by originator

from nano-memoize.

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.