# react-native-training-chat-server

> A client library for a chat server to be used in React Native training

Latest version **2.0.0** (published 2018-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-training-chat-server
pnpm add react-native-training-chat-server
yarn add react-native-training-chat-server
bun add react-native-training-chat-server
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-02-05 |
| First published | 2017-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 9 |
| Maintainers | jevakallio |

## Links

- npm: https://www.npmjs.com/package/react-native-training-chat-server
- Repository: https://github.com/jevakallio/react-native-training-chat-server
- Homepage: https://github.com/jevakallio/react-native-training-chat-server#readme
- Issues: https://github.com/jevakallio/react-native-training-chat-server/issues
- npm.io page: https://npm.io/package/react-native-training-chat-server

## Dependencies (1)

- [firebase](https://npm.io/package/firebase.md) ^4.1.2

## Recent versions

- 2.0.0 (latest) — 2018-02-05
- 1.1.2 — 2017-06-14
- 1.1.1 — 2017-06-14
- 1.1.0 — 2017-06-14
- 1.0.1 — 2017-06-13
- 1.0.0 — 2017-06-13

## README

# react-native-training-chat-server
A client library for a chat server to be used in React Native training

## API

### send({ channelName, sender, message })
Takes a single parameter with three properties: channel name, sender name and a message text. Returns a Promise.
```js
import { send } from 'react-native-training-chat-server';

send({
  channel: "ChannelName",
  sender: "Your Name",
  message: "Anything you'd like to say"
});
```

### subscribe(channelName, callback)
Callback is called every time new messages arrive to chat

```js
import { subscribe } from 'react-native-training-chat-server';

subscribe("ChannelName", messages => {
  messages.forEach(message => {
    console.log(`${message.sender}: ${message.message}`);
  })
});
```

---
_Source: https://npm.io/package/react-native-training-chat-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
