ivy-notifier
Ember CLI addon that provides easy realtime notifications.
Currently only Pusher is supported.
Installation
From within your Ember CLI app, run:
ember install:addon ivy-notifier
Usage
First, add the Pusher javascript to your app/index.html
file:
Next, define a socket inside your application. Since we're using Pusher, we'll
define a subclass of PusherSocket
inside app/sockets/pusher.js
:
; ;
Then mix in the NotifiableMixin
to any controller or route and define
a subscriptions
hash to map events to actions:
;; Controller;
This example will use the "pusher" socket we created above, and will subscribe the controller to any "test_event" events on the "test_channel" channel. Each time a "test_event" event comes in, the "testEvent" action will be triggered, passing along the event's data (if any).
Running
ember server
- Visit your app at http://localhost:4200.
Running Tests
ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.