Creates a Source from an existing AsyncIterable or async
generator function. Each value emitted becomes a success result; any
thrown error becomes an error result.
Examples
Example 1
import { Source } from "anabranch";
// From a generator function
const stream = Source.from<number, Error>(async function* () {
yield 1;
yield 2;
});
// From an AsyncIterable
async function* generate() {
yield 1;
yield 2;
}
const stream2 = Source.from<number, Error>(generate());