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
Simple, Secure Domain Registration Icon
Simple, Secure Domain Registration

Get your domain at wholesale price. Cloudflare offers simple, secure registration with no markups, plus free DNS, CDN, and SSL integration.

Register or renew your domain and pay only what we pay. No markups, hidden fees, or surprise add-ons. Choose from over 400 TLDs (.com, .ai, .dev). Every domain is integrated with Cloudflare's industry-leading DNS, CDN, and free SSL to make your site faster and more secure. Simple, secure, at-cost domain registration.
Sign up for free
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