Effect CommunityEC
Effect Community3y ago
13 replies
Alex Dixon

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()
}
Was this page helpful?