Replies: 5 comments 5 replies
-
This is pretty wild. In a good way. 😀
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
It probably is, but I will need some design advice from you to make it fit. First simple question: triggering the injection. For example, a Markdown file changes, file watcher notices, reads the file, sees it has changed. a What's the way to trigger the first injection? Larger question...these reactive components might have a lot in between observer and observable. E.g. persisting to disk, caching, validation. People might register custom before/after hooks. Is this like a custom The component writer doesn't write such things. It could be in a |
Beta Was this translation helpful? Give feedback.
-
Hmm, I worry that my need for persistent will be a deal-breaker. When you say: If |
Beta Was this translation helpful? Give feedback.
-
Regarding science fiction...where on the spectrum between:
As a note, Sphinx gets around this through the magic of pickle. 😀 |
Beta Was this translation helpful? Give feedback.
-
Current Problem
Current scopes are non-trivial to use as the scope must be propagated to all downstream dependencies. It becomes really complex when manipulating multiple scopes...
Proposal
This could be simplified by introducing two new concepts instead: a
state
dependency which Antidote could track for changes anddeterministic
dependencies only re-computed when their ownstate
dependencies changed.Example
Spec
state
.@state
defines a dependency which is cached untilreset()
is called.deterministic
, mutually exclusive withsingleton
. If so, it'll be cached and only re-computed whenever any of itsstate
dependencies change.deterministic
without anystate
dependencies will raise an error.@lazy(deterministic=True)
will check all arguments of the underlying function.@injectable(deterministic=True)
will check all arguments of__init__()
and of thefactory_method
if defined.state
nor anydeterministic
dependencies.@state
will apply@inject
to the underlying function@state
decorated function, so no parametrization like@lazy
is possible.Beta Was this translation helpful? Give feedback.
All reactions