2 ms·
Do you mean that it holds references to all versions of the memo’s dependency array AND all versions of the memo return value, or just that it holds the last ve
by jitl 5y ago
Do you mean that it holds references to all versions of the memo’s dependency array AND all versions of the memo return value, or just that it holds the last version?
- kushan2020 5y agoIt holds all of the references to the dependencies strongly, which makes sense since it is a memorization helper function. It saves all the dependencies to avoid recomputing if the same dependency shows up any time in future. But in my case I was using an old school library where you call destroy and set reference to the instance as null, and putting that as a dependency in usMemo was a bad idea.