diff --git a/reference.html b/reference.html index 18d07d6..f7f50e2 100644 --- a/reference.html +++ b/reference.html @@ -509,6 +509,41 @@ current profile.
back from the server. You can filter messages by comparing their sender field to the return value of currentProfile() to avoid processing your own messages. + +Arguments: +
subject: A valid subject (string, number or object with
+ specific keys)Returns: An ordered (oldest to newest) array of message objects.
+ +The client library keeps a cache of messages received from +subscriptions. getMessage() returns the contents of that cache.
+ +Note that only subjects for which subscribe() has been called are valid +to pass to getMessage(), and that getMessage() only returns historical messages as specified by the +arguments to subscribe(). To fetch more historical messages, call subscribe() again with different +arguments.
+ + +Arguments: +
subject: A valid subject (string, number or object with
+ specific keys)Returns: The most recent message object received, or null if none.
+ +Similar to getMessages(), but only returns the most recent message +received from the server (in server sequence number ordering). This is useful for applications +using Cosmopolite as a key/value store that don't need to interact with the historical messages. +
+