Creation
fromArray<Arr extends any[]>(arr: Arr): Channel<Flatten>
fromArray
will take an array of values and create a channel which will contain all of these values. The result channel will be closed when all values are taken.
fromPromise<PromiseType extends Promise>(promise: PromiseType, { bufferType, capacity }?: ChannelConfiguration): Channel<PromiseResponseType>
fromPromise
will take a promise and produce a channel which will contain a value resolved from promise. Result channel will be closed once that value is taken. You can additionally pass a buffer type and capacity of a result channel. By default result channel will have an Unblocking buffer with unlimited capacity.
Last updated