-
Notifications
You must be signed in to change notification settings - Fork 17
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
Creating and rendering into a canvas #39
Comments
Unless I am misunderstanding your question, this sort of parallel UI composition is already well supported by Concur. Have you tried using do
canvasId ← liftEffect random
canvas [ _id $ show canvasId ] []
<|> (liftEffect (runCanvas canvasId) *> empty) |
Composing in parallel results in |
Ah I see. Synchronous actions are run "in-place" before populating the view, but asynchronous actions are run after the view is populated and stable, equivalent to doing it in do
canvasId ← liftEffect random
canvas [ _id $ show canvasId ] []
<|> liftAff (liftEffect (runCanvas canvasId) *> empty) Note that here we have pushed the |
Hmm, using
Although, even if the runtime error is fixed, it still feels more like a workaround than intended behaviour. It's not clear from the code that |
Hmm, that seems like a bug. I'm looking at it. |
I'm trying to create a canvas element containing an animation, but I'm not sure how to compose the canvas itself with the render Effect.
With React, you can use a
componentDidMount
callback to render on a canvas, when the canvas is created in the dom. However, I don't see anything likeonComponentDidMount
.Currently, my solution looks like
This solution is not ideal for a few reasons. The
onClick
is just a placeholder to get therunCanvas
effect to run, and ending with a secondcanvas
feels like a hack.I have also considered starting an asyncronous effect with a wait loop, before calling the first
canvas
, but then I have an unnecessary wait loop and might leave orphan scripts.I'm not sure how to bundle a canvas element with it's corresponding render effect, without resorting to a workaround.
The text was updated successfully, but these errors were encountered: