• Stars
    star
    427
  • Rank 101,680 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

💧EventEmitter's typesafe replacement

💧EventEmitter's typesafe replacement💧

Home - Documentation


'evt' is intended to be a replacement for 'events'.
It makes heavy use of typescript's type inference features to provide type safety while keeping things concise and elegant 🍸.

Suitable for any JS runtime env (deno, node, old browsers, react-native ...)

Can be imported in TypeScript projects using version TypeScript >= 3.8 (February 20th, 2020) and in any plain JS projects.

NOTE: There is very few breaking changes from v1 to v2. Check them out.

Who is using it


Install / Import

In Deno:

import { Evt } from "https://deno.land/x/evt/mod.ts";

Anywhere else:

$ npm install --save evt
import { Evt } from "evt"; 

Try it

Playground

Motivations

There are a lot of things that can't easily be done with EventEmitter:

  • Enforcing type safety.
  • Removing a particular listener ( if the callback is an anonymous function ).
  • Adding a one-time listener for the next event that meets a condition.
  • Waiting (via a Promise) for one thing or another to happen.
    Example: waiting at most one second for the next message, stop waiting if the socket disconnects.

Why would someone pick EVT over RxJS:

  • EVT's learning curve is not as steep as RxJS's.
  • Generates code that is easier to grasp for people not familiar with reactive programming.

EVT is an attempt to address all these points while trying to remain as accessible as EventEmitter.


Get Started

The sticker

Shop

More Repositories

1

denoify

🦕For NPM module authors that would like to support Deno but do not want to write and maintain a port.
TypeScript
929
star
2

tss-react

✨ Dynamic CSS-in-TS solution, based on Emotion
TypeScript
631
star
3

tsafe

🔩 The missing TypeScript utils
TypeScript
400
star
4

ts-ci

🚀 A starter for TS projects meant to be published on NPM.
TypeScript
321
star
5

i18nifty

🌎 Type safe React i18n library
TypeScript
146
star
6

clean-architecture

📐 A clean architecture framework
TypeScript
47
star
7

run_exclusive

⚡🔒 Wait queue for function execution 🔒 ⚡
TypeScript
28
star
8

powerhooks

A collection of powerfull react hooks
TypeScript
26
star
9

chan-dongle-extended

An extention for chan_dongle: PIN codes, multipart SMS, contacts.
TypeScript
23
star
10

keycloakify-advanced-starter

A starter and demo project for Keycloakify v6 - Component level customization.
TypeScript
17
star
11

keycloakify-starter

A starter and demo project for Keycloakify v6 - CSS level customization.
TypeScript
10
star
12

chan-dongle-extended-pages

Shell
6
star
13

my_dummy_npm_and_deno_module

Example/tutorial on how to setup denoify
TypeScript
6
star
14

github-pages-plugin-for-type-route

Feature create-react-app/type-route/gh-pages compatibility
JavaScript
5
star
15

denoify_ci

✅ Continuous integration setup for modules using denoify
TypeScript
5
star
16

nextra-dsfr-demo

A demo project for nextra-theme-dsfr-docs
TypeScript
4
star
17

ts-promisify

Module to help work in sequencial mode with typeScript thanks to async/await
TypeScript
3
star
18

fp-ts-test-ci

test ci
TypeScript
3
star
19

asterisk

Fork of Asterisk 14.5. Version exploited by Semasim.
C
3
star
20

resume

Curriculum Vitae of Joseph Garrone
HTML
3
star
21

fuzzy-octo-guacamole

A playground for testing CI setup that deploys on Deno and NPM
TypeScript
3
star
22

ts-async-agi

Async agi implementation for node targeting typescript users ( fork from agi-node )
JavaScript
2
star
23

releases

2
star
24

working_environnement

My vim plugins, vimrc and bashrc
Vim Script
2
star
25

react-dsfr-next-demo

🚀 Starter Next + react-dsfr + MUI + TSS
TypeScript
2
star
26

ts-ami

An Asterisk manager API client
TypeScript
2
star
27

www.semasim.com

HTML
1
star
28

test-repo

Description changed
1
star
29

semasim-backend

TypeScript
1
star
30

react-screen-scaler

🖥️🔍 Design Once, Render Everywhere: Screen-size agnostic React development for uniform environments
TypeScript
1
star
31

ts-sip

A collection of low lever tools to work with the SIP protocol.
TypeScript
1
star
32

node-remove-photo-duplicate

A script to remove duplicate of the same photos
JavaScript
1
star
33

evt_react_hooks_todo_list

Created with StackBlitz ⚡️
TypeScript
1
star
34

dark-mode-ssr-demo

Demo of how to have dark mode + SSR without white flash.
CSS
1
star
35

chan-dongle-extended-client

https://garronej.github.io/chan-dongle-extended-pages/
TypeScript
1
star
36

mui-next-appdir-demo

MUI Next AppDir demo (using tss-react tooling)
TypeScript
1
star
37

evt.land

Landing page for the EVT project
EJS
1
star
38

crypto-lib

TypeScript
1
star
39

vigilant-doodle

TypeScript
1
star
40

semasim-gateway

TypeScript
1
star
41

keycloakify-demo-app-css-only

FreeMarker
1
star