Cache loaded data to avoid re-loading when cell re-runs? #2941
-
I'm trying to determine if I can implement a cache of previously loaded data so that re-running the cell will look it up in there if it was previously loaded. The idea being that additional new data from a source folder will be loaded, but not have to reload everything each time. The cached variable would only be modified from within the cell it is defined in to preserve reactivity as observed by every other cell. I was trying something like this:
But it looks like Is there a better, or any, way to approach this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This seems to work:
|
Beta Was this translation helpful? Give feedback.
-
An alternative solution is leveraging existing Julia packages such as Memoize.jl by doing |
Beta Was this translation helpful? Give feedback.
This seems to work: