connectapi
connectapi copied to clipboard
feat:`content_render()` and `content_restart()` implementations
Intent
Add content_render(content)
and content_restart(content)
functions.
Approach
-
content_render()
takes a piece of rendered content and triggers a render via thevariants
API. It returns aContentTask
object. If called on non-rendered content, raises an error. -
content_restart()
takes a piece of interactive content and sets then unsets an environment variable. If called on non-interactive content, raises an error. - Added a
default_variant
property to theContent
class, an active binding that returns its default variant. - Added two active bindings (a.k.a. dynamic properties) to
Content
:is_interactive
andis_rendered
, both booleans that are computed fromapp_mode
.
Added tests for all behaviors. I'm still feeling out testing this library; I feel like I'm used to more fully-specified unit tests rather than the more e2e style tests here.