A store over a list of rows the server owns.
Four stores had written the same load/add/update/delete by hand, and every difference between them was an accident rather than a decision:
sort above.fetchNui swallowed failures, because there
was no other way to feel responsive. It now throws, so the list follows the server
and a refused write no longer leaves the UI asserting something untrue.Neither reads nor writes pass a defaultValue, so fetchNui throws on failure instead
of masking it. Writes propagate the throw to the caller, which already had a value to
fall back to. load catches it itself and keeps the store's last known list — the
store has nothing better to show, and a background refresh that failed should not wipe
out what the player was already looking at.
For the paths a list alone cannot express — an incoming message, a local patch.
The list-store factory, so an add-on can have one.
It lives in
services/because core's own services use it, and it is exported here because an app cannot import by path (§2.7) — without this line, building a list means reimplementing the ordering, theloadedflag and the no-optimism rule that took several rewrites to settle. Paired withCrudOptions.service, which is how an app reaches its own server without a route table entry.