This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk/testing / MockRealtimeOptions

MockRealtimeOptions ​

Options of createMockRealtime.

Methods ​

isPrivate()? ​

optional isPrivate(topic): boolean

Tells whether a full topic is private, for rejectPrivate() with no argument. Default: the topic whose last segment is the user (sub) of the connection's token, like the gateway's private ones (balance:<sub>, notification:<sub>, predictions:orders:<sub>...), without depending on a list of prefixes. Pass your own predicate if the id of a public topic may coincide with the user's.

Parameters ​

topic ​

string

Full topic of the subscribe, e.g. 'balance:u-1'.

Returns ​

boolean