Creates text virtual node, which can be used to update the text without re-rendering parent element.
Text to initialize the text node
Accepts a promise or a function that returns a promise, and returns an object, which will throw a promise for any property access until the promise is settled. If the promise is successfully resolved, property access will proceed to the object returned by the promise. If the promise is rejected, property access will throw the rejection error.
Although this can be used with any promise, this should be primarily used for dynamic imports in conjunction with code-splitting, for example:
// dynamically import OtherModule
const OtherModule = mim.lazy(() => import("./OtherModule"));
function MyComp(): any
{
return <OtherModule.OtherComp />
}
OR alternatively:
// dynamically import OtherModule
const OtherComp = mim.lazy(import("./OtherModule")).OtherComp;
function MyComp(): any
{
return <OtherComp />
}
For more inormation see Component Lazy-Loading
Type to which the promise resolves. Since this function is intended to be called
with dynamic import()
statement, this type will normally be typeof import(...)
; that is,
it will be an object containing all exported module members.
Either a promise returned from the dynamic import statement or a function that returns such promise. If the parameter is a function, it will be called when the returned object is first used. This can defer downloading until the object is really needed.
Object providing property access to the object returned when the promise is resolved.
Decorator function for tagging a component's render function (or other rendering functions) so that it will not be wrapped in a watcher.
Decorator function for creating reference properties without the need to manually create Ref<> instances. This allows for the following code pattern:
class A extends mim.Component
{
@mim.ref myDiv: HTMLDivElement;
render() { return <div ref={this.myDiv}>Hello</div>; }
}
In the above example, the myDiv property will be set to point to the HTML div element.
Registers custom attribute handler class for the given property name.
Name of the custom attribute
Class handling the custom attribute functionality
Removes the content that was originally generated by the mount function.
DOM element under which the content was previously rendered.
Decorator function for components that allows them to use shadow DOM.
Examples:
// A `<div>` element will be created with shadow DOM in open mode
@mim.withShadow
class MyComponent extends mim.Component {...}
// A `<span>` element will be created with shadow DOM in open mode
@mim.withShadow("span")
class MyComponent extends mim.Component {...}
// A `<div>` element will be created with shadow DOM in closed mode
@mim.withShadow( {mode: "closed"})
class MyComponent extends mim.Component {...}
// A `<span>` element will be created with shadow DOM in closed mode
@mim.withShadow( ["span", {mode: "closed"}])
class MyComponent extends mim.Component {...}
Wraps the given callback and returns a function with identical signature.
Mimbl style scheduler as the default scheduler for style-related DOM-writing operations.