Feedback on Duration API Design Choices

I can't stop wondering about the design of Duration API. I think supporting something like "5 seconds" looks cool on demos but it has its drawbacks: autocompletion doesn't work (even tough type checking does) and it's quite wasteful (but i guess it's not a primary focus of effect 😅 ).

I know there exists Duration.seconds(5) api but I wonder why much simpler, concise API like simply passing an object: {seconds: 5} wasn't chosen? Temporal (now stage 3) uses it and it's great. So something like this would be possible:

Effect.repeat(Schedule.spaced({ seconds: 5}))


I know it's a detail but i just can't stop seeing this after working with Temporal inspired APIs in the past 😉 And maybe I am just missing something.
Was this page helpful?