From 40c165b7a10d01d20c5c093a900a1952c11a904e Mon Sep 17 00:00:00 2001 From: Coder of Salvation / Leon van Kammen Date: Mon, 2 May 2016 23:14:13 +0200 Subject: [PATCH 1/2] allow simply single i/o (pub/sub pattern) there were always 2 messages in the bus when size '1' was passed --- lib/simplebus.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/simplebus.js b/lib/simplebus.js index 8d835c4..d8f6653 100644 --- a/lib/simplebus.js +++ b/lib/simplebus.js @@ -10,7 +10,7 @@ function Bus(size) this.post = function(message) { messages.push(message); - if (size && messages.length > size) + if (size != false && messages.length >= size) messages.shift(); subscriptions.forEach(function(sub) { @@ -150,4 +150,4 @@ exports.createBus = function(size) { return new Bus(size); } exports.createServer = function (bus, port, host) { return new Server(bus, port, host); } -exports.createClient = function (port, host) { return new Client(port, host); } \ No newline at end of file +exports.createClient = function (port, host) { return new Client(port, host); } From 38f48ae51b6d06f14e6f6cba9a09bcd4ed10d28e Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 28 May 2020 21:25:35 +0200 Subject: [PATCH 2/2] added sponsor-button --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..f744573 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://gumroad.com/l/hGYGh