0.8.2 • Published 3 years ago

tcd-message-center v0.8.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

TCD Message Center

This is a backend in front-end library for TCD for messaging.

Install

Run the following command in your project

yarn add tcd-message-center # or npm install tcd-message-center

Usage

Import the main class which is MessageCenter.

import { MessageCenter } from "tcd-message-center"

Create an instance of MessageCenter

const messageCenter = new MessageCenter({
  auth: firebase.auth(),
  storage: firebase.storage(),
  functions: firebase.functions(),
  realtime: firebase.database()
})

Retrieve Chat objects from this messageCenter object.

const chats: Chat[] = messageCenter.getChats(10, 0); // limit, offset

Now, you can start your work on each Chat object whenever that object is ready.

import {ChatEvents, MessageEvents} from "tcd-message-center"
chat.on(ChatEvents.READY, () => {
  //your code...
})

These ChatEvents, MessageEvents and CountEvents are available on Chat object.

CountEvents.Unread is also available on MessageCenter object to listen for total unread count on all chats.

API Docs

Class Chat is an EventEmitter class. So you can trigger and listen for events on any Chat object.

0.7.23

3 years ago

0.8.2

3 years ago

0.8.0

3 years ago

0.7.22

3 years ago

0.7.21

3 years ago

0.7.20

3 years ago

0.7.13

3 years ago

0.7.12

3 years ago

0.7.19

3 years ago

0.7.18

3 years ago

0.7.15

3 years ago

0.7.14

3 years ago

0.7.17

3 years ago

0.7.16

3 years ago

0.7.11

3 years ago

0.7.10

3 years ago

0.7.9

3 years ago

0.7.8

3 years ago

0.7.7

3 years ago

0.7.6

3 years ago

0.7.5

3 years ago

0.7.4

3 years ago

0.7.2

3 years ago

0.7.3

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.6

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.5

4 years ago

0.6.4

4 years ago

0.5.8

4 years ago

0.5.7

4 years ago

0.5.9

4 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.6

4 years ago

0.5.5

4 years ago

0.5.0

4 years ago

0.5.2

4 years ago

0.6.0

4 years ago

0.5.1

4 years ago

0.4.1

4 years ago

0.3.2

4 years ago

0.4.0

4 years ago

0.4.2

4 years ago

0.3.3

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago