3.1.0 • Published 2 years ago

event-emitter-async-iterator v3.1.0

Weekly downloads
26
License
MIT
Repository
github
Last release
2 years ago

Example

In GraphQL server subscription:

Subscription: {
	myCommand: {
		subscribe: (obj, args, context, info) => {

			const asyncIterator = new EventEmitterAsyncIterator();

			const pushMyCommand = (myCommand) => {
				asyncIterator.pushValue({
					myCommand: myCommand
				});
			};

			asyncIterator.once('return', () => {
				// The client has unsubscribed
			});

			return asyncIterator;
		}
	}
}
3.1.0

2 years ago

3.0.0

2 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.1

5 years ago

1.0.0

5 years ago