INNER CODE UNIT · Python

WithContext

volfpeter/htmy · htmy/core.py:38

class WithContext(Fragment):
    """
    A simple, static context provider component.
    """

    __slots__ = ("_context",)

    def __init__(self, *children: ComponentType, context: Context) -> None:
        """
        Initialization.

        Arguments:
            *children: The children components to wrap in the given context.
            context: The context to make available to children components.
        """
        super().__init__(*children)
        self._context = context

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…