LazyCell
LazyCell will lazily evaluate its contents from a function whenever you attempt to obtain the contents and they are null. Combine this withinvalidate()
in order to re-evaluate the contents using the
function.
Several modules have their own wrapper of this, e.g. Core has the
OpModeLazyCell
and OpModeFreshLazyCell
and Mercurial has the
SubsytemObjectCell
. These wrappers provide additional functionality tied to
their specific domains.
InvalidatingCell
Invalidating Cell is like lazy cell, but has a built in self invalidation function as well.self
parameter, as this
will cause stack overflow, this is what the contents
parameter is for.