Skip to content

Update to Cats Effect v3.5.0-RC1#192

Merged
armanbilge merged 5 commits intomainfrom
update/cats-effect-3.5.0-RC1
Feb 14, 2023
Merged

Update to Cats Effect v3.5.0-RC1#192
armanbilge merged 5 commits intomainfrom
update/cats-effect-3.5.0-RC1

Conversation

@armanbilge
Copy link
Copy Markdown
Owner

We now take advantage of the new runtime and remove a lot of hacks!

How it works is described in the updated documentation.

calico/docs/index.md

Lines 121 to 130 in a4ee610

However, there are certain situations where you may want the browser to re-render in the middle of a task. In these cases, simply sequence an `IO.cede` operation. This will temporarily yield control flow back to the browser so that it may re-render the UI, before resuming the task.
```scala
updateComponentA *> // doesn't render yet
updateComponentB *> // still didn't render
IO.cede *> // re-render now
doOtherStuff *> ... // do non-view-related work
```
Explicitly inserting an `IO.cede` can be a useful strategy to improve your app’s UX, by re-rendering as soon as you are done updating the view, and deferring other work until after the re-render. This will make your UI more responsive.

Closes #150.

Copy link
Copy Markdown
Contributor

@2chilled 2chilled left a comment

Choose a reason for hiding this comment

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

Exciting, thank you!

@armanbilge armanbilge merged commit 5799248 into main Feb 14, 2023
@armanbilge armanbilge deleted the update/cats-effect-3.5.0-RC1 branch February 14, 2023 15:32
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.

Revisit DomHotswap and .cedeBackground

2 participants