Skip to content

flypapertech/nativescript-sse

 
 

Repository files navigation

NativeScript Server Sent Events

npm npm Build Status

A NativeScript client for the Server Sent Events (SSE).

Install

npm install nativescript-sse

Usage

import { SSE } from 'nativescript-sse';

let sse = new SSE(serverApi: string, headers: object);
sse.events.on('onConnect', (data) => {
    console.log(data.object.connected);
});
sse.events.on('onMessage', (data) => {
    this.list.push(JSON.parse(data.object.message.data))
});
sse.events.on('onError', (data) => {
    console.log(data.object.error);
});
see.close();

About

A NativeScript plugin for Server-Sent Events

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 58.9%
  • JavaScript 29.2%
  • Shell 11.9%