mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-04-24 08:34:48 +00:00
Updated SubscriptionDefinition's debounce to use strategy. Removed factory method call on CommonJS import in tests
This commit is contained in:
parent
72388c6ae8
commit
c34650abc5
9 changed files with 9 additions and 11 deletions
|
|
@ -280,8 +280,7 @@
|
|||
if (_.isNaN(milliseconds)) {
|
||||
throw "Milliseconds must be a number";
|
||||
}
|
||||
var fn = this.callback;
|
||||
this.callback = _.debounce(fn, milliseconds, !! immediate);
|
||||
this.callback.useStrategy(postal.configuration.strategies.debounce(milliseconds, immediate));
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
|||
2
lib/postal.min.js
vendored
2
lib/postal.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
|||
/* global describe, postal, it, after, before, expect */
|
||||
(function(){
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js")() : window.postal;
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js") : window.postal;
|
||||
var expect = typeof window === "undefined" ? require("expect.js") : window.expect;
|
||||
var bindingsResolver = postal.configuration.resolver;
|
||||
describe( "amqpBindingsResolver", function () {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* global describe, postal, it, after, before, expect */
|
||||
(function(){
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js")() : window.postal;
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js") : window.postal;
|
||||
var expect = typeof window === "undefined" ? require("expect.js") : window.expect;
|
||||
var ChannelDefinition = postal.ChannelDefinition;
|
||||
describe( "channel definition", function () {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* global describe, postal, it, after, before, expect */
|
||||
(function() {
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js")() : window.postal;
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js") : window.postal;
|
||||
var expect = typeof window === "undefined" ? require("expect.js") : window.expect;
|
||||
var subscription;
|
||||
describe("linked channels", function () {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* global describe, postal, it, after, before, expect */
|
||||
(function(global) {
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js")() : window.postal;
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js") : window.postal;
|
||||
var expect = typeof window === "undefined" ? require("expect.js") : window.expect;
|
||||
var _ = typeof window === "undefined" ? require("underscore") : window._;
|
||||
var subscription;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* global describe, postal, it, after, before, expect */
|
||||
(function() {
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js")() : window.postal;
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js") : window.postal;
|
||||
var expect = typeof window === "undefined" ? require("expect.js") : window.expect;
|
||||
var NO_OP = function () {};
|
||||
var SubscriptionDefinition = postal.SubscriptionDefinition;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* global describe, postal, it, after, before, expect */
|
||||
(function() {
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js")() : window.postal;
|
||||
var postal = typeof window === "undefined" ? require("../lib/postal.js") : window.postal;
|
||||
var expect = typeof window === "undefined" ? require("expect.js") : window.expect;
|
||||
var _ = typeof window === "undefined" ? require("underscore") : window._;
|
||||
var NO_OP = function() {};
|
||||
|
|
|
|||
|
|
@ -68,8 +68,7 @@ SubscriptionDefinition.prototype = {
|
|||
if ( _.isNaN( milliseconds ) ) {
|
||||
throw "Milliseconds must be a number";
|
||||
}
|
||||
var fn = this.callback;
|
||||
this.callback = _.debounce( fn, milliseconds, !!immediate );
|
||||
this.callback.useStrategy(postal.configuration.strategies.debounce(milliseconds, immediate));
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue