Reference¶
ViewDOM only has a few public symbols to be used by other packages.
Here’s the API.
ViewDOM.
- viewdom.Context(children=None, **kwargs)¶
Like the React Conext API.
- class viewdom.VDOMNode(tag, props, children)¶
Implementation of a node with three slots.
- Parameters:
tag (str) –
props (Mapping) –
children (List[Union[str, VDOMNode]]) –
- viewdom.encode_prop(k, v)¶
If possible, reduce an attribute to just the name.
- viewdom.flatten(value)¶
Reduce a sequence.
- viewdom.htm(cache_maxsize=128)¶
The callable function to act as decorator.
- viewdom.relaxed_call(callable_, registry=None, children=None, props=None)¶
Get the correct implementation and call it to produce a vdom.
- viewdom.render(value, registry=None, **kwargs)¶
Render a VDOM to a string.
- viewdom.render_gen(value, registry=None, children=None)¶
Render as a generator.
- Parameters:
registry (Optional[Registry]) –
- viewdom.use_context(key, default=None)¶
Similar to the React use context API.