![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@basic-streams/from-iterable
Advanced tools
fromIterable<T>(
iterable: Iterable<T>,
interval?: number,
scheduler?: (time: number) => Stream<void>
): Stream<T>
Given an iterable
, returns a stream that produces items from that iterable. If
an interval
is provided the items will be spread in time. Interval is a number
of milliseconds by which items should be spread. The first item also will be
delayed by that interval. If the interval is 0
the items will be produced as
soon as possible but still asynchronously.
Also, you can provide a custom scheduler
, a function that creates a stream
that produces an event after a given ammount of milliseconds. By default
later
is used as a scheduler.
import fromIterable from "@basic-streams/from-iterable"
import later from "@basic-streams/later"
//
// simplest case
fromIterable([1, 2, 3])(x => {
console.log(x)
})
// > 1
// > 2
// > 3
//
// with an interval
fromIterable([1, 2, 3], 10)(x => {
console.log(x)
})
// > 1
// > 2
// > 3
// _________1_________2_________3
//
// with a generator function
function* generator() {
const startTime = Date.now()
yield Date.now() - startTime
yield Date.now() - startTime
yield Date.now() - startTime
}
fromIterable(generator(), 10)(x => {
console.log(x)
})
// > 0
// > 10
// > 20
// 0 10 20
// _________._________._________.
//
// with a custom scheduler
function scheduler(time) {
return later(time / 2)
}
fromIterable([1, 2, 3], 10, scheduler)(x => {
console.log(x)
})
// > 1
// > 2
// > 3
// ____1____2____3
FAQs
fromIterable operator for basic-streams
The npm package @basic-streams/from-iterable receives a total of 1 weekly downloads. As such, @basic-streams/from-iterable popularity was classified as not popular.
We found that @basic-streams/from-iterable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.