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

Use elm-units for durations #16

Open
MartinSStewart opened this issue Mar 4, 2021 · 1 comment
Open

Use elm-units for durations #16

MartinSStewart opened this issue Mar 4, 2021 · 1 comment

Comments

@MartinSStewart
Copy link

MartinSStewart commented Mar 4, 2021

Hi, one suggestion I have is to use elm-units instead or having your own API for dealing with durations. Then you can just have after : Duration -> msg -> Cmd msg, sequence : List ( Duration, msg ) -> Cmd msg, and sequenceIf : Bool -> List ( Duration, msg ) -> Cmd msg and anyone familiar with elm-units won't need to relearn how to specify what time units they want or do extra conversions if they are already using elm-units for other stuff.

@andrewMacmurray
Copy link
Owner

Thanks @MartinSStewart, there was a suggestion on this thread https://discourse.elm-lang.org/t/elm-delay-4-0-0/7031/3 that the duration functions read a bit awkwardly and that withUnit could be more general and could accommodate things like elm-unit in a nicer way.

elm-units definitely has a nice api! I think given that elm-delay is so tiny it would be a shame to force others to use this as a peer dependency, particularly if their use case is very simple

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

No branches or pull requests

2 participants