1.0.12 • Published 3 years ago

service-commons v1.0.12

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

Service Commons

Provides common building blocks for creating service infrastructure, including in servers and client APIs.

This contains

Injection: the implementation of Injection from the @angular/core project to help with service extensibility patterns. WebSockets: WebSocketClientService wraps a WebSocket with an rxjs Observer.

WebSocketClientService

const wsService = new WebSocketClientService(WebSocketEnvironment.Node);
const handleMessage = (data) => {
  console.debug("data: " + data);
};
const subMessages = <Subject<MessageEvent>>wsService
  .create(URL)
  .pipe(
    map((response: MessageEvent): any => {
      // We have to parse because message data is always text
      const data = JSON.parse(response.data);
      handleMessage(data);
      return data;
    }));

Notes

https://www.npmjs.com/package/ws

1.0.2

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.12

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago