Skip to content

Commit

Permalink
Add lazy to notConnectedSlot as signalNotConnected
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre-Herve committed Aug 22, 2019
1 parent debdd1e commit 11e2252
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Slot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any, any> = Object.assign(
() => signalNotConnected(),
{
on: signalNotConnected,
lazy: signalNotConnected
}
)

export type LazyCallback = (param: string) => void
export type Unsubscribe = () => void
Expand Down

0 comments on commit 11e2252

Please sign in to comment.