A function calls its callback immediately when data is cached and later (after a fetch) otherwise. What is the problem?
Code written after the call may run before or after the callback depending on the cache. Deferring the cached case (queueMicrotask / setTimeout) makes behaviour predictable.