Improve the comment on clear-subsscription-cache!
This commit is contained in:
parent
dc5fa8b566
commit
53abcfc184
|
@ -18,17 +18,15 @@
|
||||||
(def query->reaction (atom {}))
|
(def query->reaction (atom {}))
|
||||||
|
|
||||||
(defn clear-subscription-cache!
|
(defn clear-subscription-cache!
|
||||||
"Runs on-dispose for all subscriptions we have in the subscription cache.
|
"Causes all subscriptions to be removed from the cache.
|
||||||
Used to force recreation of new subscriptions. Should only be necessary
|
Does this by:
|
||||||
in development.
|
1. running on-dispose on all cached subscriptions
|
||||||
|
2. These on-dispose will then do the removal of themselves.
|
||||||
|
|
||||||
The on-dispose functions for the subscriptions will remove themselves from the
|
This is a development time tool. Useful when reloading Figwheel code
|
||||||
cache.
|
after a React exception, because React components won't have been
|
||||||
|
cleaned up properly. And this, in turn, means the subscriptions within those
|
||||||
Useful when reloading Figwheel code after a React exception, as React components
|
components won't have been cleaned up correctly. So this forces the issue."
|
||||||
aren't cleaned up properly. This means a subscription's on-dispose function isn't
|
|
||||||
run when the components are destroyed. If a bad subscription caused your exception,
|
|
||||||
then you can't fix it without reloading your browser."
|
|
||||||
[]
|
[]
|
||||||
(doseq [[k rxn] @query->reaction]
|
(doseq [[k rxn] @query->reaction]
|
||||||
(dispose! rxn))
|
(dispose! rxn))
|
||||||
|
|
Loading…
Reference in New Issue