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

riot-observable

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

riot-observable - npm Package Compare versions

Comparing version 2.0.0-beta.2 to 2.0.3-beta

9

dist/observable.js

@@ -83,3 +83,3 @@ ;(function(window, undefined) {var observable = function(el) {

var fns = callbacks[name] || []
var fns = (callbacks[name] || []).slice(0)

@@ -89,4 +89,7 @@ for (var i = 0, fn; fn = fns[i]; ++i) {

fn.busy = 1
fn.apply(el, fn.typed ? [name].concat(args) : args)
if (fns[i] !== fn) i--
// avoid that this fn.busy gets stuck in case of errors it fixes #3
try {
fn.apply(el, fn.typed ? [name].concat(args) : args)
} catch (e) { /* error */}
if (fns[i] !== fn) { i-- }
fn.busy = 0

@@ -93,0 +96,0 @@ }

@@ -83,3 +83,3 @@ riot.observable = function(el) {

var fns = callbacks[name] || []
var fns = (callbacks[name] || []).slice(0)

@@ -89,4 +89,7 @@ for (var i = 0, fn; fn = fns[i]; ++i) {

fn.busy = 1
fn.apply(el, fn.typed ? [name].concat(args) : args)
if (fns[i] !== fn) i--
// avoid that this fn.busy gets stuck in case of errors it fixes #3
try {
fn.apply(el, fn.typed ? [name].concat(args) : args)
} catch (e) { /* error */}
if (fns[i] !== fn) { i-- }
fn.busy = 0

@@ -93,0 +96,0 @@ }

@@ -83,3 +83,3 @@ var observable = function(el) {

var fns = callbacks[name] || []
var fns = (callbacks[name] || []).slice(0)

@@ -89,4 +89,7 @@ for (var i = 0, fn; fn = fns[i]; ++i) {

fn.busy = 1
fn.apply(el, fn.typed ? [name].concat(args) : args)
if (fns[i] !== fn) i--
// avoid that this fn.busy gets stuck in case of errors it fixes #3
try {
fn.apply(el, fn.typed ? [name].concat(args) : args)
} catch (e) { /* error */}
if (fns[i] !== fn) { i-- }
fn.busy = 0

@@ -93,0 +96,0 @@ }

{
"name": "riot-observable",
"version": "2.0.0-beta.2",
"version": "2.0.3-beta",
"description": "Simple script to send and receive events",

@@ -22,9 +22,9 @@ "main": "dist/observable.js",

"devDependencies": {
"coveralls": "^2.11.3",
"eslint": "^1.0.0",
"coveralls": "^2.11.4",
"eslint": "^1.4.1",
"expect.js": "^0.3.1",
"karma": "^0.13.3",
"karma-coverage": "^0.4.2",
"karma": "^0.13.9",
"karma-coverage": "^0.5.2",
"karma-mocha": "^0.2.0",
"karma-phantomjs-launcher": "^0.2.0"
"karma-phantomjs-launcher": "^0.2.1"
},

@@ -31,0 +31,0 @@ "author": "Muut, Inc. and other contributors",

@@ -141,3 +141,3 @@ describe('Core specs', function() {

el.on('e1', function() { this.trigger('e2') })
el.on('e1', function() { e2 = true })
el.on('e2', function() { e2 = true })

@@ -291,3 +291,30 @@ el.trigger('e1')

it('Do not block callback throwing errors', function(done) {
el.on('event', function() { counter++; throw 'OH NOES!' })
el.on('event', function() { counter++ })
el.trigger('event')
setTimeout(function() {
el.trigger('event')
expect(counter).to.be(4)
done()
}, 1000)
})
it('The one event is called once also in a recursive function', function() {
el.one('event', function() {
counter ++
el.one('event', function() {
counter ++
})
})
el.trigger('event')
expect(counter).to.be(1)
el.trigger('event')
expect(counter).to.be(2)
})
})

Sorry, the diff of this file is not supported yet

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