Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default unit #8

Closed
andrewMacmurray opened this issue Feb 24, 2021 · 3 comments · Fixed by #15
Closed

Default unit #8

andrewMacmurray opened this issue Feb 24, 2021 · 3 comments · Fixed by #15

Comments

@andrewMacmurray
Copy link
Owner

Curious if anyone is using a mixture of TimeUnits? Was thinking about changing the api to have a default unit of milliseconds so it's a little cleaner:

Delay.after 500 SomethingTriggered
Delay.sequence
    [ ( 100, MsgOne )
    , ( 200, MsgTwo )
    , ( 100, MsgThree )
    ]

And maybe add some helpers to convert millis to other time units:

Delay.after (Delay.seconds 5) SomethingTriggered
seconds : Millis -> Millis
seconds millis =
    1000 * millis

@lenards given you've been using this recently do you have any thoughts?

@alenards
Copy link

I have tended to use only one TimeUnit and that's usually milliseconds.

I do like the idea of the Delay.seconds so it's clear at the "call site" what units are being used.

I would be down to take a crack at doing the helpers if you'd like.

@andrewMacmurray
Copy link
Owner Author

That's good to know, thanks @alenards. I was planning on doing the cleanups this weekend but would be good to get some feedback / review from you if that's cool?

@lenards
Copy link
Contributor

lenards commented Feb 26, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants