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

Refactor implicit conversions to VDomModifier #160

Merged
merged 1 commit into from Jan 17, 2018

Conversation

mariusmuja
Copy link
Collaborator

More consistent handling of implicit conversions to VDomModifier though the AsVDomModifier type class. This removes all (except one) implicit conversions to VDomModifier from the dom package object.

It also allows to have Seq[String], Seq[Int] (any Seq[T : AsVomModifier]) in the VDom (see #155).

node.innerHTML shouldBe "1"

OutWatch.renderReplace(node, div(1.0)).unsafeRunSync()
node.innerHTML shouldBe "1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is a Double 1.0 rendered as 1 and not 1.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently that's how Scala.js renders Double.toString:

https://scalafiddle.io/sf/OcJkymj/0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! I just tried in the scala REPL and it was "1.0".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scala REPL is JVM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to say that. 😄

@mariusmuja mariusmuja merged commit fc71430 into outwatch:master Jan 17, 2018
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 this pull request may close these issues.

None yet

2 participants