added an experimental avoidDomDiffing API; refs #121
This commit is contained in:
parent
9cf08c4f9c
commit
6a0c2871ad
1 changed files with 8 additions and 0 deletions
|
|
@ -595,6 +595,14 @@ proc runDiff*(kxi: KaraxInstance; oldNode, newNode: VNode) =
|
||||||
var onhashChange {.importc: "window.onhashchange".}: proc()
|
var onhashChange {.importc: "window.onhashchange".}: proc()
|
||||||
var hashPart {.importc: "window.location.hash".}: cstring
|
var hashPart {.importc: "window.location.hash".}: cstring
|
||||||
|
|
||||||
|
proc avoidDomDiffing*(kxi: KaraxInstance = kxi) =
|
||||||
|
## enforce a full redraw for the next redraw operation.
|
||||||
|
## This can be used as a temporary way to workaround DOM diffing
|
||||||
|
## problems or to avoid the DOM diffing when you already know
|
||||||
|
## it should use a completely new DOM.
|
||||||
|
## This is an experimental API.
|
||||||
|
kxi.currentTree = nil
|
||||||
|
|
||||||
proc dodraw(kxi: KaraxInstance) =
|
proc dodraw(kxi: KaraxInstance) =
|
||||||
if kxi.renderer.isNil: return
|
if kxi.renderer.isNil: return
|
||||||
let rdata = RouterData(hashPart: hashPart)
|
let rdata = RouterData(hashPart: hashPart)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue