Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

create-emit

Introduction

Tiny 20 lines of functional type safe event emitter/pubsub.

Comparing to other emitters, create-emit cares more about type safe.

Installation

npm install --save create-emit
# or
yarn add create-emit

Usage

// create event with `string` type of payload
const sayHi = createEmit<string>()

// you can watch for the event to happen
const unsubscribe = sayHi.watch(console.log)

// fire the event with payload
sayHi('Peter') // Peter
sayHi('Drew')  // Drew

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages