reactpy icon indicating copy to clipboard operation
reactpy copied to clipboard

IDOM Component: Deferred Loader

Open Archmonger opened this issue 3 years ago • 1 comments
trafficstars

Current Situation

Right now there's no method of deferring a component load until a list of CSS or JS has fully loaded.

Original Discussion

  • #723

Proposed Actions

Develop a DeferredLoader component that waits until a list of CSS has loaded until rendering a component.

from idom.html import _, link

def my_top_level_component():
    return DeferredLoader(
        [
            link({"rel": "stylesheet", "href": "Path1.css"}),
            link({"rel": "stylesheet", "href": "Path2.css"}),
        ],
        my_deferred_component(),
    )

def my_deferred_component():
    pass

Note: onLoad/onError will trigger on successful/unsuccessful CSS loads. This event propagates up to a top-level div, so that simplifies this implementation.

Archmonger avatar Apr 08 '22 00:04 Archmonger

@rmorshea We might want a type-external-package tag for issues tracked in core but would result in a completely new package.

Archmonger avatar Mar 18 '23 02:03 Archmonger

Closing this as it's probably better developed and maintained by a community member, if interest arises.

Archmonger avatar Feb 23 '24 09:02 Archmonger