I see a lot of callback functions accept a parameter referred to as context
in the GoInstant documentation, but it's not clear what this parameter is or what it's used for.
Asked
Active
Viewed 120 times
3
1 Answers
5
The context parameter contains meta-data about the event.
The full docs are here: https://developers.goinstant.net/v1/key/context.html
It includes:
- the type of command (SET, GET, etc.)
- the name of the key
- the value of the key after the operation
- the room to which the key belongs
- the user that instantiated the action
- a
local
boolean used to indicate whether the change was triggered locally or remotely - and a bubble boolean used to indicate whether the event was triggered from this key or a child key.
It can be useful to understand where and why you are receiving the event.
Disclosure: I work at GoInstant.

secretmike
- 9,814
- 3
- 33
- 38
-
2That is pretty bad name for a parameter of a function that takes a callback – Esailija Jul 16 '13 at 14:25