File

src/api/realtime/channel.ts

Description

Channel object is basically an observable which emits every single event received from the according channel to its subscribers.

Should never be instantiated itself yet obtained from RealTime module instead.

Extends

Observable

Example

const channel = rtm.channel("my_channel");

// For the typescript users it is also possible to point out the type of messages
// you expect from the channel:

const channel = rtm.channel<MyData>("my_channel");

Index

Methods

Methods

Public getLog
getLog(filter?: IFilteringCriterion | IFilteringCriterionCallback)

Load channel messaging history

Parameters :
Name Type Optional Description
filter IFilteringCriterion<T> | IFilteringCriterionCallback<T> Yes

filtering condition

Example :
rtm.channel(&quot;my_channel&quot;).getLog(); // returns an observable of full channel history</p>
<p>// filtering messages
rtm.channel(&quot;my_channel&quot;).getLog(field =&gt; field(&quot;sender_id&quot;).isEqualTo(user.id)); // messages from certain user
Public publish
publish(data: any)

Send a message to the channel

Parameters :
Name Type Optional
data any No
Returns : Observable<RealTimeCommandResponse>

result-matching ""

    No results matching ""