Overthinking the Coolness of a Code Snippet
Am I overthinking how cool this is?
const q = Effect.runSync(Queue.sliding(2**4))
pipe(
Queue.take(q),
Effect.flatMap(Console.log),
Effect.forever,
Effect.runFork
)
const send = () =>
Effect.runSync(q.offer(Date.now())
for (let i = 0; i++; i < 100) {
send()
}
const q = Effect.runSync(Queue.sliding(2**4))
pipe(
Queue.take(q),
Effect.flatMap(Console.log),
Effect.forever,
Effect.runFork
)
const send = () =>
Effect.runSync(q.offer(Date.now())
for (let i = 0; i++; i < 100) {
send()
}
