@advanced-rest-client/arc-messages-servicedeprecated

Messages synchronization service for ARC

Usage no npm install needed!

<script type="module">
  import advancedRestClientArcMessagesService from 'https://cdn.skypack.dev/@advanced-rest-client/arc-messages-service';
</script>

README

Published on NPM

Build Status

Published on webcomponents.org

arc-messages-service

A service to synchronize messages from service provider to app users.

The service queries ARC application server for new messages and stores in local data store. The messages are presented to the user in message center of Advanced REST Client.

Usage

Installation

npm install --save @advanced-rest-client/arc-messages-service

In a LitElement

import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/arc-messages-service/arc-messages-service.js';

class SampleElement extends LitElement {
  render() {
    return html`
    <arc-messages-service
      platform="electron-app"
      channel="stable"
      automessages
      @messages-changed="${this._messagesHandler}"
      @unread-changed="${this._unreadHandler}"></arc-messages-service>
    `;
  }
}
customElements.define('sample-element', SampleElement);

Note that unread messages are included in messages.

To mark a message as read use markRead() function which takes message key property as only argument. This operation changes size of unread property.

To mark all are read use makrkAllRead() function. This eventually clears unread array.

Development

git clone https://github.com/advanced-rest-client/arc-messages-service
cd arc-messages-service
npm install

Running the tests

npm test

API components

This components is a part of API components ecosystem