Replies: 3 comments 3 replies
-
And how to perform some side effects, such as network IO, on a defined In my superficial understanding div("a", cls := "w-full h-full bg-slate-400 ml-[77px]").evalTap(_ =>
IO {
println("hello")
}
)
|
Beta Was this translation helpful? Give feedback.
-
@cyz1901 have you seen this example? http://armanbilge.github.io/calico/demos/http4s.html |
Beta Was this translation helpful? Give feedback.
-
Every page can have its own state. For example: def page1 = SignallingRef[IO].of(0).toResource.flatMap { counter =>
// build page one here
}
def page2 = SignallingRef[IO].of(false).toResource.flatMap { toggle =>
// build page two here
} Let me know if that makes sense :) |
Beta Was this translation helpful? Give feedback.
-
Hey @armanbilge. I am currently trying to add backend support(http) to the page in a project using Calico.
So I chose the https-dom library to integrate.
What has been confusing me all along is whether the calico library only supports passing in at the top.
Like in this example
If I only need to call the backend interface when a certain page is opened, or if I want to store certain states on a specific page (only applicable to that page), I don't want to persist them to the browser, only in memory of the current page.
My current idea is to put all the states at the entrance and then upload them to the required page, as we discussed.
I thought about it for a moment, and there will be two questions
If there are many things that need to be passed in, then many layers will be nested (this can be solved by splitting out more functions)
All states are initialized when the webpage is first opened, and as more pages expand, more and more data is stored in memory. When I switch to another page, because it is a globally transmitted item, will it cause the application to lag (imagine that a page will store a large amount of content about files and then store them in the
GlobalStore
. Then I switched pages, but these file data should still be stored in memory, right)Perhaps in functional programming, I don't need to worry that everything has already been handled...:flushed:
Can you give me some advice if you have time?
Beta Was this translation helpful? Give feedback.
All reactions