0.2.4 • Published 1 year ago

react-native-awesome-mqtt v0.2.4

Weekly downloads
10
License
MIT
Repository
github
Last release
1 year ago

react-native-awesome-mqtt

MQTT Client for React Native

The story

This is a port of repo sp-react-native-mqtt for Typescript.

I rewrite the original repo into Typescript, with some adjustments to be compatible with my project.

Thank to the author and his work.

Installation

yarn add react-native-awesome-mqtt rxjs

Usage

import AwesomeMqtt from "react-native-awesome-mqtt";
import type {Subscription} from 'rxjs';

AwesomeMqtt.createClient({
  uri: 'tcp://localhost:1883',
  username: 'user',
  password: 'pass',
  tls: false,
  clientId: 'react-native-awesome-mqtt',
})
  .then((client: AwesomeMqtt) => {
    client.on('connect', (event: AwesomeMqtt.NativeEvent) => {
      const subscription: Subscription = client.message.subscribe((message: AwesomeMqtt.NativeEvent) => {

      });
    });
    client.on('error', (event: AwesomeMqtt.NativeEvent) => {

    });
    client.on('closed', (event: AwesomeMqtt.NativeEvent) => {

    });
  });

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.2.3

1 year ago

0.2.4

1 year ago

0.2.1

2 years ago

0.2.2

1 year ago

0.1.0

3 years ago

0.1.2

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago