Home Reference Source
import SkygearChatPubsub from 'skygear-chat/lib/pubsub.js'
public class | source

SkygearChatPubsub

SkygearChatPubsub is a class for dsipatching the message from user_channel to the coorrect handler according to the event type and registeration

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public

pubsub: *

public
public

Method Summary

Public Methods
public

dispatch(payload: *)

public

dispatchTyping(data: *)

public

dispatchUpdate(data: *)

public

async getUserChannel(): *

public

sendTyping(conversation: *, state: *)

public

async subscribeAllTyping(handler: *): *

public

subscribeDispatch(channel: *)

public

async subscribeMessage(handler: *): *

public

async subscribeTyping(conversation: *, handler: *): *

public
public

unsubscribeDispatch(channel: *)

public

unsubscribeMessage(handler: *)

public

unsubscribeTyping(conversation: *, handler: *)

public

Public Constructors

public constructor() source

Public Members

public allTypingHandler: *[] source

public messageHandler: *[] source

public pubsub: * source

public typingHandler: {} source

public userChannel: * source

Public Methods

public dispatch(payload: *) source

Params:

NameTypeAttributeDescription
payload *

public dispatchTyping(data: *) source

Params:

NameTypeAttributeDescription
data *

public dispatchUpdate(data: *) source

Params:

NameTypeAttributeDescription
data *

public async getUserChannel(): * source

Return:

*

public sendTyping(conversation: *, state: *) source

Params:

NameTypeAttributeDescription
conversation *
state *

public async subscribeAllTyping(handler: *): * source

Params:

NameTypeAttributeDescription
handler *

Return:

*

public subscribeDispatch(channel: *) source

Params:

NameTypeAttributeDescription
channel *

public async subscribeMessage(handler: *): * source

Params:

NameTypeAttributeDescription
handler *

Return:

*

public async subscribeTyping(conversation: *, handler: *): * source

Params:

NameTypeAttributeDescription
conversation *
handler *

Return:

*

public async subscribeUserChannel(): * source

Return:

*

public unsubscribeDispatch(channel: *) source

Params:

NameTypeAttributeDescription
channel *

public unsubscribeMessage(handler: *) source

Params:

NameTypeAttributeDescription
handler *

public unsubscribeTyping(conversation: *, handler: *) source

Params:

NameTypeAttributeDescription
conversation *
handler *

public unsubscribeUserChannel() source