Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-phoenix

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-phoenix - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

bower.json
{
"name": "angular-phoenix",
"version": "0.2.1",
"version": "0.2.2",
"authors": [

@@ -5,0 +5,0 @@ "MikaAK <mikakalathil@gmail.com>"

@@ -115,2 +115,4 @@ 'use strict';

channels.set(name, { status: 'connected', channel: channel, promise: promise });
}, function () {
return console.warn('connection timed out...');
});

@@ -123,10 +125,20 @@

PhoenixBase.Channel.prototype.leave = function () {
var _oldLeave = angular.copy(phoenix.Channel.prototype.leave);
return function leave() {
channels.set(this.topic, { status: 'disconnected' });
return _oldLeave.call(this);
};
};
return {
base: PhoenixBase,
socket: socket,
leave: function leave(name) {
if (!channels.get(name)) {
leave: function leave(chan) {
var channel = channels.get(chan.topic);
if (!channel || channel.status === 'disconnected') {
return;
}socket.leave(name);
channels.set(name, { status: 'disconnected' });
}channel.leave();
},

@@ -133,0 +145,0 @@

{
"name": "angular-phoenix",
"version": "0.2.1",
"version": "0.2.2",
"description": "Native bindings for phoenix in angular",

@@ -5,0 +5,0 @@ "main": "dist/angular-phoenix.js",

@@ -84,5 +84,5 @@ 'use strict'

this.$get = ['PhoenixBase', (PhoenixBase) => {
var socket = new PhoenixBase.Socket(urlBase),
channels = new Map(),
joinChannel= (name, message) => {
var socket = new PhoenixBase.Socket(urlBase),
channels = new Map(),
joinChannel = (name, message) => {
var joinRes,

@@ -107,3 +107,3 @@ promise,

channels.set(name, {status: 'connected', channel, promise})
})
}, () => console.warn('connection timed out...'))

@@ -116,11 +116,22 @@ return angular.extend(channel, {promise})

PhoenixBase.Channel.prototype.leave = (() => {
var _oldLeave = angular.copy(PhoenixBase.Channel.prototype.leave)
return function leave() {
channels.set(this.topic, {status: 'disconnected'})
return _oldLeave.call(this)
}
})();
return {
base: PhoenixBase,
socket: socket,
leave(name) {
if (!channels.get(name))
leave(chan) {
var channel = channels.get(chan.topic)
if (!channel || channel.status === 'disconnected')
return
socket.leave(name)
channels.set(name, {status: 'disconnected'})
channel.leave()
},

@@ -127,0 +138,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc