How to use the awe.element_updater.Updater function in awe

To help you get started, we’ve selected a few awe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dankilman / awe / awe / view.py View on Github external
skip_dispatch = kwargs.pop('_awe_skip_dispatch', None)
        arg = kwargs.pop('_awe_arg', None)
        args = [arg] if arg else []
        # type: Element
        result = element_type(
            root=self.root,
            parent=self,
            element_id=element_id,
            props=props,
            style=style,
            stack=self._stack,
        )
        self._register(result)
        result._init(*args, **kwargs)
        if updater:
            self._register(element_updater.Updater(
                element=result,
                updater=updater
            ))
        result._init_complete = True
        self.children.append(result)
        if not skip_dispatch:
            self._dispatch(result._get_new_element_action())
        return result
github dankilman / awe / awe / page.py View on Github external
def _register(self, obj, obj_id=None):
        if isinstance(obj, element_updater.Updater):
            self._element_updater.add(obj)
        else:
            self._registry.register(obj, obj_id)