Documentation
¶
Overview ¶
Package listkey is the one rule a list keys its items by (D67): the core's ListState, which diffs a list, and the Go client, which applies the diffs, both key with ItemID, as the TypeScript runtime's itemID does in the browser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ItemID ¶
func ItemID(item json.RawMessage) (string, error)
ItemID is the key a list keys an item by (ListState, and every client applying a ListChange the same way; its errors: no object, no or a null id, an id neither string nor number), read from the member spelled exactly "id" (no case-insensitive alias): a JSON string as it is, a JSON number as JavaScript's Number toString writes it (1, 1.0 and 1e0 are one id; 1234567 stays plain; 1e21 and 1e-7 take exponent form; -0 is 0), so the server and the browser key the same.
Types ¶
This section is empty.