subscribe-ui-event
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -11,3 +11,3 @@ /** | ||
var ee = require('../eventEmitter').eventEmitter; | ||
var leIE8 = require('../leIE8'); | ||
var leIE8 = require('../lib/leIE8'); | ||
@@ -86,3 +86,3 @@ var EVENT_END_DELAY = 200; | ||
} | ||
clearTimeout(timer); | ||
@@ -89,0 +89,0 @@ if (leIE8) { |
@@ -10,3 +10,3 @@ /** | ||
var eventHandlers = require('./eventHandlers'); | ||
var leIE8 = require('./leIE8'); // less then or equal to IE8 | ||
var leIE8 = require('./lib/leIE8'); // less then or equal to IE8 | ||
var rAFThrottle = require('./lib/rAFThrottle'); | ||
@@ -13,0 +13,0 @@ var subscriptions = require('./eventEmitter').subscriptions; |
{ | ||
"name": "subscribe-ui-event", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A single, throttle built-in solution to subscribe to browser UI Events.", | ||
@@ -38,3 +38,3 @@ "main": "index.js", | ||
"grunt-contrib-clean": "^0.6.0", | ||
"grunt-contrib-connect": "^0.10.1", | ||
"grunt-contrib-connect": "^0.11.0", | ||
"grunt-contrib-jshint": "^0.11.2", | ||
@@ -48,6 +48,6 @@ "grunt-contrib-watch": "^0.6.1", | ||
"istanbul": "^0.3.0", | ||
"jsdom": "^3.0.0", | ||
"jsdom": "^6.0.0", | ||
"jshint": "^2.5.1", | ||
"jsx-loader": "^0.13.2", | ||
"minimist": "^0.2.0", | ||
"minimist": "^1.0.0", | ||
"mocha": "^2.0", | ||
@@ -57,3 +57,3 @@ "mockery": "^1.4.0", | ||
"react": "^0.13.x", | ||
"xunit-file": "^0.0.5" | ||
"xunit-file": "^0.0.6" | ||
}, | ||
@@ -60,0 +60,0 @@ "precommit": [ |
# subscribe-ui-event | ||
[![npm version](https://badge.fury.io/js/subscribe-ui-event.svg)](http://badge.fury.io/js/subscribe-ui-event) | ||
[![Build Status](https://travis-ci.org/yahoo/subscribe-ui-event.svg?branch=master)](https://travis-ci.org/yahoo/subscribe-ui-event) | ||
[![Coverage Status](https://coveralls.io/repos/yahoo/subscribe-ui-event/badge.svg)](https://coveralls.io/r/yahoo/subscribe-ui-event) | ||
[![Dependency Status](https://david-dm.org/yahoo/subscribe-ui-event.svg)](https://david-dm.org/yahoo/subscribe-ui-event) | ||
[![devDependency Status](https://david-dm.org/yahoo/subscribe-ui-event/dev-status.svg)](https://david-dm.org/yahoo/subscribe-ui-event#info=devDependencies) | ||
@@ -6,0 +8,0 @@ `subscribe-ui-event` provides an cross-browser and performant way to subscribe to browser UI Events. |
@@ -11,21 +11,33 @@ /** | ||
GLOBAL.window = { | ||
addEventListener: function (eventType, cb) { | ||
ee.on(eventType, cb); | ||
}, | ||
setTimeout: function (cb, wait) { | ||
cb(); | ||
} | ||
}; | ||
GLOBAL.document = { | ||
addEventListener: function (eventType, cb) { | ||
ee.on(eventType, cb); | ||
} | ||
}; | ||
var expect = require('expect.js'); | ||
var subscribe = require('../../../src/subscribe'); | ||
var subscribe; | ||
describe('subscribe', function () { | ||
before(function () { | ||
GLOBAL.window = { | ||
addEventListener: function (eventType, cb) { | ||
ee.on(eventType, cb); | ||
}, | ||
setTimeout: function (cb, wait) { | ||
cb(); | ||
} | ||
}; | ||
GLOBAL.document = { | ||
addEventListener: function (eventType, cb) { | ||
ee.on(eventType, cb); | ||
} | ||
}; | ||
require.cache[require.resolve('../../../src/eventHandlers')] = undefined; | ||
require.cache[require.resolve('../../../src/lib/leIE8')] = undefined; | ||
require.cache[require.resolve('../../../src/subscribe')] = undefined; | ||
}); | ||
after(function () { | ||
GLOBAL.window = undefined; | ||
GLOBAL.document = undefined; | ||
}); | ||
beforeEach(function () { | ||
subscribe = require('../../../src/subscribe'); | ||
ee.removeAllListeners('scroll'); | ||
@@ -35,2 +47,3 @@ ee.removeAllListeners('resize'); | ||
}); | ||
describe('#subscribe', function () { | ||
@@ -37,0 +50,0 @@ it('scroll should be triggered by window scroll', function (done) { |
39872
17
890
79