-
-
Notifications
You must be signed in to change notification settings - Fork 715
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn user when calling subscribe outside of a reactive context
Calling subscribe outside of a reactive context will cache the subscription, but there will be no ratoms around to remove the subscription from the cache when the ratom is disposed. This can lead to memory leaks where subscriptions stay in the cache indefinately. This should fix issue #740
- Loading branch information
1 parent
c7c8b27
commit 6cd9341
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,3 +91,7 @@ | |
"Doesn't make sense in a Clojure context currently." | ||
[reactive-val] | ||
"rx-clj") | ||
|
||
(defn reactive? | ||
[] | ||
true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,3 +72,7 @@ | |
reagent.ratom/Track "tr" | ||
"other") | ||
(hash reactive-val)))) | ||
|
||
(defn reactive? | ||
[] | ||
(reagent.ratom/reactive?)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters