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

Reduce unnecessary DOM rendering from renderEach() in prelude.kt #128

Closed
sanity opened this issue May 2, 2020 · 2 comments
Closed

Reduce unnecessary DOM rendering from renderEach() in prelude.kt #128

sanity opened this issue May 2, 2020 · 2 comments

Comments

@sanity
Copy link
Member

sanity commented May 2, 2020

Create an extension function for rendering Collections within KVars:

val c : KVar<List<Int>> = KVar(listOf(1, 2, 3))
// inside Kweb {}
renderEach(c) { v : KVar<Int> ->
  h1().text(v.map { it.toString() })
}

The trick here will be to efficiently handle element insertion and deletion while minimizing DOM modifications.

see also: #123 (comment)

@sanity sanity changed the title Add function to render KVar<Collection<T>>s Add function to render KVars containing collections May 2, 2020
@sanity
Copy link
Member Author

sanity commented May 9, 2020

Simple implementation of this here released in 0.7.12, although unnecessarily re-renders list if the list size changes so leaving this issue open until that can be made more efficient.

@sanity sanity changed the title Add function to render KVars containing collections Reduce unnecessary DOM rendering from renderEach() in prelude.kt May 9, 2020
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Oct 12, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant