This is the ThingsDB documentation for version v0, click here for the latest version!

watch

Subscribe for watching mutations on a stored thing. If this function is called on a thing which is not stored, and therefore has no #ID, then a value_err() is raised. This function returns nil, but every call always triggers an init event, even if it involves multiple calls of this function on the same thing.

This function only works with socket connections. When using this function with an HTTP API request, it has no effect.

This function does not generate an event.

Function

thing.watch()

Arguments

None

Return value

Returns nil.

Example

This code shows how to use watch():

.watch();

Return value in JSON format:

null