d-connection

1.0.0 • Public • Published

Derby Connection

A Derby JS connection component.

Installation

$ npm install d-connection --save

Usage

Create a view:

<index: element="connection">
  {{if #root.$connection.state === 'disconnected'}}
  <div class="alert">
    Disconnected
    <button class="btn pull-right" disabled="{{reconnecting}}">
      {{reconnecting ? 'Reconnecting...' : 'Reconnect'}}
    </button>
  </div>
  {{/}}

Associate your view with the component:

app.use('connection', require('d-connection'));

Use the view:

<Body:>
  <connection timeout="1500"></connection>

Methods

reconnect() - Attempts to reconnect to the server.

Properties

reconnecting - Boolean that is set to true while attempting to reconnecting.

timeout - The amount of time in milliseconds that it will wait to reconnect. Defaults to 1000.

Package Sidebar

Install

npm i d-connection

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • psirenny