resourceloader: Restore mw.loader.store update postponing logic
* Document the conditional that disables mw.loader.store if
localStorage is unavailable. `raw === undefined` is correct,
but can be confusing given it can also be null, and we
specifically don't want to disable the store in that case.
We only disable the store if raw is undefined.
* Remove the call to mw.loader.store.update() in init().
If 0 modules were to load on the current page, there is little
value in flushing an empty `items` object.
If any modules load, they will be set() in the store and
schedule an update() at that time, which is preferred and avoids
unexpected overhead.
* Remove store.enabled check from prune(). It is only called
from update(), which checks it already.
* Remove boolean return from set(). Not used.
* Remove boolean return from prune(). Not used.
* Restore the 2-second setTimeout debounce from 2013 (
c719401661e),
which got lost in the 2015 refactor (
4174b662f623).
This makes the documentation true again.
* Document the store singleton as @private. It will still be
indexed by JSDuck and listed in the sidebar (under "private"),
but will not be listed on the homepage, and the class' page
will have a notice about it being a private API.
Bug: T202598
Change-Id: Ic0d4a15c241df391ab5f824ca9e754c3938ea108