From 97b3b0ccb3908a6f8c97011322eaf713b4fc6dfc Mon Sep 17 00:00:00 2001 From: Robin Pokorny Date: Sun, 6 Dec 2020 20:33:33 +0100 Subject: [PATCH] :zap: update format --- eventEmitter.spec.js | 4 +--- pubsub.js | 4 ++-- pubsub.spec.js | 4 +--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/eventEmitter.spec.js b/eventEmitter.spec.js index 181d9ce..60bbf65 100644 --- a/eventEmitter.spec.js +++ b/eventEmitter.spec.js @@ -13,9 +13,7 @@ describe("Event Emitter", () => { }); it("has simple API", () => { - const keys = Object.keys(emitter) - .sort() - .join(); + const keys = Object.keys(emitter).sort().join(); expect(keys).toBe("emit,on"); }); diff --git a/pubsub.js b/pubsub.js index b973cdd..9e5efcc 100644 --- a/pubsub.js +++ b/pubsub.js @@ -1,13 +1,13 @@ module.exports = () => { const subscribers = new Set(); - const sub = fn => { + const sub = (fn) => { subscribers.add(fn); return () => subscribers.delete(fn); }; - const pub = data => subscribers.forEach(fn => fn(data)); + const pub = (data) => subscribers.forEach((fn) => fn(data)); return Object.freeze({ pub, sub }); }; diff --git a/pubsub.spec.js b/pubsub.spec.js index ef7fb82..e805f39 100644 --- a/pubsub.spec.js +++ b/pubsub.spec.js @@ -11,9 +11,7 @@ describe("PubSub", () => { }); it("has simple API", () => { - const keys = Object.keys(events) - .sort() - .join(); + const keys = Object.keys(events).sort().join(); expect(keys).toBe("pub,sub"); });