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

Mouse.clicks #9

Closed
rtfeldman opened this issue Apr 6, 2018 · 5 comments
Closed

Mouse.clicks #9

rtfeldman opened this issue Apr 6, 2018 · 5 comments

Comments

@rtfeldman
Copy link

I'd like to use both this package as well as elm-lang/mouse for Mouse.clicks.

This is currently impossible because both packages expose a module called Mouse, so as soon as I install both and write import Mouse, I get an error because it's an ambiguous import (due to elm/compiler#1625).

elm-lang/mouse only exposes 4 subscriptions. What do you think of adding elm-lang/mouse as a dependency to this library and exposing them as well?

@mpizenberg
Copy link
Owner

Thanks for the remark! I've always played with elm apps having full control over DOM so didn't realized this unfortunate name collision. I don't mind re-exposing those.

Regarding the API, I've used the tuple convention with floats ( Float, Float ) in the rest of the package. In elm-lang/mouse, it's a record of integers that is used { x : Int, y : Int }. Do you think I should

(1) simply expose as-is, noting that this is here mostly to avoid namespace collision
(2) Sub.map the subscriptions to present at as a ( Float, Float )

I'm more for (1) since (2) would make no sense if I don't return a Mouse.Event anyway.

@mpizenberg
Copy link
Owner

Actually I don't know how to expose them. I also cannot import elm-lang Mouse module without having a compiler error ...

@rtfeldman
Copy link
Author

rtfeldman commented Apr 6, 2018 via email

@mpizenberg
Copy link
Owner

It seems that Mouse doesn't exist anymore in the new elm and that the only possible collision left is with zwilias/elm-touch-events Touch module. Do you know if there is a mechanism in 0.19 to prevent those kind of collisions? Otherwise, I will probably try to find a fitting prefix namespace.

@mpizenberg
Copy link
Owner

Modules are now all namespaced under Html.Events.Extra... so there are no conflicts anymore. More info in changelog.

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