Alex MacArthur's Blog · Jan 14, 2025
Short-Lived, Tick-Bound Memoization in JavaScript
0Sign in to vote or save
This site took too long to answer. You can still read it on the original site — the toolbar below keeps your place in the directory.
I'm always looking for excuses to use queueMicrotask() , a relatively sparsely used function for inserting tasks at the end of the current call stack. I might've stumbled across one dealing with short-lived memoization. Humor me for a bit. You've likely seen some variation of this memoization function in JavaScript. Pass in an expensive function, and you get back a different function that'll cache…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.