From debe0db71e6cf97b00d7eb3d371511fb9b5a33c0 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 23 Nov 2023 06:59:41 +0100 Subject: [PATCH] Prettierify code --- index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a158efe..956b5fe 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,18 @@ export let createNanoEvents = () => ({ emit(event, ...args) { - for (let i = 0, callbacks = this.events[event] || [], length = callbacks.length; i < length; i++) { + for ( + let i = 0, + callbacks = this.events[event] || [], + length = callbacks.length; + i < length; + i++ + ) { callbacks[i](...args) } }, events: {}, on(event, cb) { - (this.events[event]||=[]).push(cb); + ;(this.events[event] ||= []).push(cb) return () => { this.events[event] = this.events[event]?.filter(i => cb !== i) }