Skip to content

More explicit types in examples#190

Merged
armanbilge merged 4 commits intomainfrom
pr/i189
Feb 13, 2023
Merged

More explicit types in examples#190
armanbilge merged 4 commits intomainfrom
pr/i189

Conversation

@armanbilge
Copy link
Copy Markdown
Owner

And some other minor tidying.

Closes #189. @hejfelix were these the ones you were thinking, any others I should add to?

@hejfelix
Copy link
Copy Markdown

Yeah. I think adding them to all the *.md code would hammer home the point that components are Resource[F, HtmlElement[F]].

Comment thread docs/counter.md
)

app.renderInto(node.asInstanceOf[fs2.dom.Node[IO]]).allocated.unsafeRunAndForget()
app.renderInto(node.asInstanceOf[fs2.dom.Node[IO]]).useForever.unsafeRunAndForget()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This asInstanceOf looks a bit "hacky", at least for people not knowing background story. It also kind of leaks the opaque type. Maybe we can hide that somehow.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Yeah, the unsafeRunAndForget() also is not so great 😅 maybe we can move these out of the code block 🤔

@armanbilge armanbilge merged commit 33cac95 into main Feb 13, 2023
@armanbilge armanbilge deleted the pr/i189 branch February 13, 2023 17:16
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.

Add types to all methods in examples

3 participants