Skip to content
Browse files

added an experimental avoidDomDiffing API; refs #121

  • Loading branch information...
Araq committed Sep 28, 2019
1 parent 9cf08c4 commit 6a0c2871adfa24c3b2083239262df8c2073f60b6
Showing with 8 additions and 0 deletions.
  1. +8 −0 karax/karax.nim
@@ -595,6 +595,14 @@ proc runDiff*(kxi: KaraxInstance; oldNode, newNode: VNode) =
var onhashChange {.importc: "window.onhashchange".}: proc()
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) =
if kxi.renderer.isNil: return
let rdata = RouterData(hashPart: hashPart)

0 comments on commit 6a0c287

Please sign in to comment.
You can’t perform that action at this time.