1.1.7 • Published 5 years ago

event-promised v1.1.7

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

EventPromised

Combine event and promise

Example :

import EventPromised from "event-promised";

new EventPromised((resolve, error, emit) => {
    emit("A","Print for event A");
    emit("B", "Print for event B");
    emit("B", "Not printed because subscibed from once");
    resolve("Promise solved");
})
.on("A", (res) => {
    console.log(res); //Print for event A
})
.once("B", (res) => {
    console.log(res); //Print for event B
})
.then((res) => {
    console.log(res); //Promise solved
})
.then(() => new EventPromised((resolve) =>  resolve("Result from new EventPromised promise")))
.then((res) => {
    console.log(res); //Result from new EventPromised promise
})
1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago