generated from calcit-lang/calcit-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
clear cache_
jiyinyiyong edited this page Sep 1, 2021
·
1 revision
clear-cache!
Respo has two copies of caches inside for the purpose of:
- DOM diffing
- speed up rendering
The first one is easy to understand since virtual DOM is corresponding to the DOM we currently see in the page. That's why it's cached.
The second one is for rendering, maybe I should explain it in shouldComponetUpdate
-like process. Most times this virtual DOM is same with the previous one for diffing. But during hot code swapping, it's not. DOM state is updated, however, caches should be removed. That's why there's a second one.
clear-cache!
is to clear the second cache, during hot swapping.