angular2-phoenix-channels
A package that lets you use Phoenix channels as Angular 2 Observables.
Configuration
When you bootstrap your app, you'll need to setup a provider and pass in your websocket uri.
let phoenixChannelsProvider = ; ;
Usage
Have your service injected with PhoenixChannels
Join a channel.
let allCandidatesChannel = thisphoenixChannels;allCandidatesChannel;
Observe messages. observeMessage
returns an observable can call subscribe
or any other observable operators on.
let phoenixObservable = thisallCandidatesChannel;
You can merge this observable with other observables.
{ let httpObservable = thishttp; let phoenixObservable = thisallCandidatesChannel; return Observable;}
Examples
Angular 2 app: http://github.com/gaslight/campg-angular2.git
Phoenix server for above app: http://github.com/superchris/hirem_server.git