From 11e22527f4a318962e43ca2032d55e6e8c5a8185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Herv=C3=A9?= Date: Thu, 22 Aug 2019 16:11:28 +0200 Subject: [PATCH] Add `lazy` to `notConnectedSlot` as `signalNotConnected` --- src/Slot.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Slot.ts b/src/Slot.ts index 9340dec..d809ec0 100644 --- a/src/Slot.ts +++ b/src/Slot.ts @@ -4,8 +4,13 @@ import { DEFAULT_PARAM } from './Constants' const signalNotConnected = () => { throw new Error('Slot not connected') } -const notConnectedSlot: any = () => signalNotConnected() -notConnectedSlot.on = signalNotConnected +const notConnectedSlot: Slot = Object.assign( + () => signalNotConnected(), + { + on: signalNotConnected, + lazy: signalNotConnected + } +) export type LazyCallback = (param: string) => void export type Unsubscribe = () => void