Skip to content
This repository was archived by the owner on Aug 10, 2024. It is now read-only.

Commit 4b38420

Browse files
committed
Refactor setValue()
1 parent d7576fd commit 4b38420

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main/kotlin/kweb/prelude.kt

+2-5
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ abstract class ValueElement(open val element: Element, val kvarUpdateEvent: Stri
525525
}
526526
set(v) {
527527
if (_valueKvar != null) error("`value` may only be set once, and cannot be set after it has been retrieved")
528-
setValue(v, updateOn = kvarUpdateEvent)
528+
updateKVar(v, updateOn = kvarUpdateEvent)
529529
_valueKvar = v
530530
}
531531

@@ -552,13 +552,10 @@ abstract class ValueElement(open val element: Element, val kvarUpdateEvent: Stri
552552
oldString.substring(oldString.length - diffData.postfixOffset)
553553
}
554554
}
555-
println("applied String = ${newString}")
556555
return newString
557556
}
558557

559-
fun setValue(toBind: KVar<String>, updateOn: String = "input") {
560-
//setValue(toBind as KVal<String>)
561-
558+
private fun updateKVar(toBind: KVar<String>, updateOn: String = "input") {
562559
on(
563560
//language=JavaScript
564561
retrieveJs = "get_diff_changes(document.getElementById(\"${element.id}\"))")

0 commit comments

Comments
 (0)