3.0.1 • Published 6 years ago
@advanced-rest-client/arc-messages-service v3.0.1
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-serviceIn 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 installRunning the tests
npm testAPI components
This components is a part of API components ecosystem