v0.5.0
Changes
- Replace
createPromiseClient
withcreateCallbackClient
- Replace
emitter.stop()
function withCancelFn
from Callback Client
Example
const cancel = emitter.start();
// Cancel after 3 seconds
setTimeout(cancel, 3000);
New event emitters
- close
- fatalError
type LocalEventTypes = {
close: [error?: ConnectError];
fatalError: [error: FatalError];
};
Examples
// End of Stream
emitter.on("close", (error) => {
if (error) {
console.error(error);
}
});
// Fatal error
emitter.on("fatalError", (error) => {
console.error(error);
});
What's Changed
- Implement CallbackClient by @DenisCarriere in #9
Full Changelog: v0.4.4...v0.5.0