This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Defines the function type of the publish function. | |
* | |
* Extracts the keys from `E` as valid event types, and the matching | |
* property as the payload. | |
*/ | |
type PubTypeFn<E> = <Key extends string & keyof E>( | |
event: Key, | |
fn: (message: E[Key]) => void | |
) => void |