Determines whether the component is currently mounted. If a component has asynchronous functionality (e.g. fetching data from a server), component's code may be executed after it was already unmounted. This property allows the component to handle this situation.
Component properties passed to the constructor. This is normally used only by managed components and is usually undefined for independent components.
Remembered virtual node object through which the component can request services. This is undefined in the component's costructor but will be defined before the call to the (optional) willMount method.
String representation of the component
Schedules the given function to be called either before or after components update cycle.
Function to be called
If true, the function is called before the component updates cycle; if false - after the cycle.
Argument that will be passed to the function.
Object that will be used as "this" value when the function is called. If this parameter is undefined, the component instance will be used (which allows scheduling regular unbound components' methods). This parameter will be ignored if the function is already bound or is an arrow function.
Defines whether and how Mimbl tick is scheduled after the function is called
Fires an event of the given type. The detail
parameter is interpreted differently for
built-in and custom events. For built-in events (that is, events whose type derives from
Event), this is the event object itself. For custom events, it becomes the value of the
detail
property of the CustomEvent object.
Defines a range of possible values for the eventType
parameter. K is a key
from the TEvent
type.
Event type name, which is a key from the TEvents
type
Event data, whose type is defined by the type mapped to the key
in the TEvents
type.
This method can be overridden to provide content to display information about the given error
Retrieves the value for a service with the given ID registered by a closest ancestor component or the default value if none of the ancestor components registered a service with this ID. This method doesn't establish a subscription and only reflects the current state.
Unique service identifier
Default value to return if no publish service is found.
Flag indicating whether the search for the service should start from the
virtual node that calls this method. The default value is false
meaning the search starts
from the parent virtual node.
Current value of the service or default value if no published service is found.
This method can be overridden to provide content to display while waiting for promises
Registers the given value as a service with the given ID that will be available for consumption by descendant components.
Unique service identifier
Current value of the service
Number of level to watch for changes. The default value is 1; that is, the subscribers will be notified if the service's value or the values of its properties have changed.
Publication object, which allows setting a new value of the service or changing values of its properties.
Re-renders the component with either the given content or, if the content parameter is undefined, with the original children provided to the component in the props.
New content to render the component with or undefined to render with the original children.
Returns the component's content that will be ultimately placed into the DOM tree. This method is abstract because it must be implemented by every component.
Implements the functionality of the IErrorBoundary interface.
Subscribes to a service with the given ID. If the service with the given ID is registered
by this or one of the ancestor components, the returned subscription object's value
property will reference it; otherwise, the value will be set to the defaultValue (if
specified) or will remain undefined. Whenever the value of the service that is registered by
this or a closest ancestor component is changed, the subscription's value
property will
receive the new value.
If the subscription object's value
property is used in a component's rendering code, the
component will be re-rendered every time the service value is changed.
Unique service identifier
Optional default value that will be assigned if the service is not published yet.
Flag indicating whether the search for the service should start from the
virtual node that calls this method. The default value is false
meaning the search starts
from the parent virtual node.
Subscription object, which provides the value of the service and allowes attaching to the event fired when the value is changed.
This method is called by the component to request to be updated.
Callback function to be wrapped
Optional argument to be passed to the callback in addition to the original callback arguments.
Optional object to be used as this
when calling the callback. If this
parameter is not defined, the component instance is used, which allows wrapping regular
unbound components' methods. This parameter will be ignored if the the function is already
bound or is an arrow function.
Type of scheduling the Mimbl tick after the callback function returns.
Wrapped callback that will run the original callback in the proper context.
Component that serves as a boundary for errors and unsettled promises. If descendent components throw errors, the nearest to them Boundary component catches and handles them. This component provides a minimal UI informing the user about the error or the fact that it is waiting for a promise. Derived components can provide their own way to display information about the errors and the waiting status.