This is a javascript client for elasticfeed server.
{
channel: {
url: 'localhost',
transport: '[ws|lp|sse]'
}
}elasticfeed.init({
channel: {
url: 'ws://localhost:10100/stream/ws',
transport: 'ws'
}
});var feed = elasticfeed.initFeed('84:30:26', {
outputContainerId: 'my-elastic-feed',
stylerFunction: function(data) {
return '<div>' + data + '</div>';
}
});Creates and returns feed instance (creates new channel if required).
Creates and returns channel instance.
Returns existing feed instance or false if does not exist.
Returns existing channel instance or false if does not exist.
Supports three types of communication over HTTP protocol: WebSocket, Long pooling (XHR), SSE (Server Sent Events + XHR).
{
transport: 'ws',
host: 'localhost',
port: '10100'
url: ''
}var channel = new Channel(options);channel.on('join', function(chid, timestamp) {});
channel.on('leave', function(chid, timestamp) {});
channel.on('message', function(chid, timestamp, systemEvent) {});var feed = new Feed(id, options, channel);feed.on('reload', function(timestamp) {});
feed.on('empty', function(timestamp) {});
feed.on('entry', function(timestamp, Entry) {});
feed.on('entry-init', function(timestamp, []Entry) {});
feed.on('entry-more', function(timestamp, []Entry) {});
feed.on('entry-message', function(timestamp, entryEvent) {});
feed.on('hide', function(timestamp) {});
feed.on('show', function(timestamp) {});
feed.on('authenticated', function(timestamp) {});
feed.on('authentication-required', function(timestamp) {});
feed.on('authentication-failed', function(timestamp) {});
feed.on('logout', function(timestamp) {});Sends request to the server
Sends request to the server
Empty feed and trigger initial load.
Removes entries from feed and DOM
Refresh entries in the DOM.
Bind to the message event on the channel instance.
var entry = new Entry(data, options);entry.on('update', function(timestamp, data) {});
entry.on('delete', function(timestamp) {});
entry.on('hide', function(timestamp) {});
entry.on('show', function(timestamp) {});Set parent of type feed and binds to the messages stream on the feed instance.
Bind to the entry-message event on the parent feed instance.
Unbind from the entry-message event.
Refresh object in the DOM.
Represents states of communication levels. There are channelEvent, systemEvent, feedEvent and entryEvent.
Type grunt watch to produce dist files for each change.
Type grunt to build distribution files.
MIT