Mitt was made for the browser, but works in any JavaScript runtime. It has no dependencies and supports IE9+. This project uses node and npm. Go check them out if you don't have them locally installed. Then with a module bundler like rollup or webpack, use as you would anything else. The UMD build is also available on unpkg. Set "strict": true in your tsconfig.json to get improved type inference for mitt instance methods. Alternatively, you can use the provided Emitter type. Remove an event handler for the given type. If handler is omitted, all handlers of the given type are removed. Invoke all handlers for the given type. If present, '*' handlers are invoked after type-matched handlers.

Features

  • Weighs less than 200 bytes gzipped
  • Provides a wildcard event type listens to all events
  • Same names & ideas as Node's EventEmitter
  • Methods don't rely on this
  • Mitt was made for the browser
  • works in any JavaScript runtime

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Mitt

Mitt Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Mitt!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Browser Extensions and Plugins

Registered

2021-08-24