A valid route definition.
The avatar
helper displays a user's avatar.
Attributes to apply to the avatar element
The fullTime
helper displays a formatted time string wrapped in a
The highlight
helper searches for a word phrase in a string, and wraps
matches with the tag.
The string to highlight.
The word or words to highlight.
The humanTime
helper displays a time in a human-friendly time-ago format
(e.g. '12 days ago'), wrapped in a
The icon
helper displays an icon.
The full icon class, prefix and the icon’s name.
Any other attributes to apply.
The listItems
helper wraps an array of components in the provided tag,
stripping out any unnecessary Separator
components.
By default, this tag is an <li>
tag, but this is customisable through the
second function parameter, customTag
.
The punctuateSeries
helper formats a list of strings (e.g. names) to read
fluently in the application's locale.
punctuateSeries(['Toby', 'Franz', 'Dominion']) // Toby, Franz, and Dominion
')}
The useronline
helper displays a green circle if the user is online
The username
helper displays a user's username in a
tag. If the user doesn't exist, the username will be displayed as [deleted].
The abbreviateNumber
utility converts a number to a shorter localized form.
The anchorScroll
utility saves the scroll position relative to an element,
and then restores it after a callback has been run.
This is useful if a redraw will change the page's content above the viewport. Normally doing this will result in the content in the viewport being pushed down or pulled up. By wrapping the redraw with this utility, the scroll position can be anchor to an element that is in or below the viewport, so the content in the viewport will stay the same.
The element to anchor the scroll position to.
The callback to run that will change page content.
The computed
utility creates a function that will cache its output until
any of the dependent values are dirty.
The computed
utility creates a function that will cache its output until
any of the dependent values are dirty.
Escapes the RegExp
special characters in input
.
Get all of the registered handlers for an event.
The name of the event.
Unregister an event handler.
The name of the event.
The function that handles the event.
Register an event handler.
The name of the event.
The function to handle the event.
Register an event handler so that it will run only once, and then unregister itself.
The name of the event.
The function to handle the event.
Trigger an event.
The name of the event.
Arguments to pass to event handlers.
The extract
utility deletes a property from an object and returns its
value.
The object that owns the property
The name of the property to extract
The value of the property
Extract the text nodes from a virtual element.
The formatNumber
utility localizes a number into a string with the
appropriate punctuation based on the provided locale otherwise will default to the users locale.
The humanTime
utility converts a date to a localized, human-readable time-
ago string.
Returns if the passed value is an object.
In this context, "object" refers to any non-primitive value, including arrays, function, maps, dates, and more.
The liveHumanTimes
initializer sets up a loop every 1 second to update
timestamps rendered with the humanTime
helper.
The mapRoutes
utility converts a map of named application routes into a
format that can be understood by Mithril, and wraps them in route resolvers
to provide each route with the current route name.
The mixin
utility assigns the properties of a set of 'mixin' objects to
the prototype of a parent object.
The class to extend the new class from.
The objects to mix in.
A new class that extends Parent and contains the mixins.
Mithril 2 does not completely rerender the page if a route change leads to the same route (or the same component handling a different route). This util calls m.route.set, forcing a reonit.
Convert the given string to a unique color.
Check if class A is the same as or a subclass of class B.
An event handler factory that makes it simpler to implement data binding for component event listeners.
The handler created by this factory passes the DOM element's attribute identified by the first argument to the callback (usually a bidirectional Mithril stream: https://mithril.js.org/stream.html#bidirectional-bindings).
Replaces m.withAttr for Mithril 2.0.
Extend an object's method by running its output through a mutating callback every time it is called.
The callback accepts the method's return value and should perform any mutations directly on this value. For this reason, this function will not be effective on methods which return scalar values (numbers, strings, booleans).
Care should be taken to extend the correct object – in most cases, a class' prototype will be the desired target of extension, not the class itself.
The object that owns the method
The name or names of the method(s) to extend
A callback which mutates the method's output
Override an object's method by replacing it with a new function, so that the new function will be run every time the object's method is called.
The replacement function accepts the original method as its first argument,
which is like a call to super
. Any arguments passed to the original method
are also passed to the replacement.
Care should be taken to extend the correct object – in most cases, a class' prototype will be the desired target of extension, not the class itself.
The object that owns the method
The name or names of the method(s) to override
The method to replace it with
The avatar
helper displays a user's avatar.
Attributes to apply to the avatar element
The fullTime
helper displays a formatted time string wrapped in a
The highlight
helper searches for a word phrase in a string, and wraps
matches with the tag.
The string to highlight.
The word or words to highlight.
The humanTime
helper displays a time in a human-friendly time-ago format
(e.g. '12 days ago'), wrapped in a
The icon
helper displays an icon.
The full icon class, prefix and the icon’s name.
Any other attributes to apply.
The listItems
helper wraps an array of components in the provided tag,
stripping out any unnecessary Separator
components.
By default, this tag is an <li>
tag, but this is customisable through the
second function parameter, customTag
.
The punctuateSeries
helper formats a list of strings (e.g. names) to read
fluently in the application's locale.
punctuateSeries(['Toby', 'Franz', 'Dominion']) // Toby, Franz, and Dominion
')}
The useronline
helper displays a green circle if the user is online
The username
helper displays a user's username in a
tag. If the user doesn't exist, the username will be displayed as [deleted].
The abbreviateNumber
utility converts a number to a shorter localized form.
The anchorScroll
utility saves the scroll position relative to an element,
and then restores it after a callback has been run.
This is useful if a redraw will change the page's content above the viewport. Normally doing this will result in the content in the viewport being pushed down or pulled up. By wrapping the redraw with this utility, the scroll position can be anchor to an element that is in or below the viewport, so the content in the viewport will stay the same.
The element to anchor the scroll position to.
The callback to run that will change page content.
The computed
utility creates a function that will cache its output until
any of the dependent values are dirty.
The computed
utility creates a function that will cache its output until
any of the dependent values are dirty.
Escapes the RegExp
special characters in input
.
Get all of the registered handlers for an event.
The name of the event.
Unregister an event handler.
The name of the event.
The function that handles the event.
Register an event handler.
The name of the event.
The function to handle the event.
Register an event handler so that it will run only once, and then unregister itself.
The name of the event.
The function to handle the event.
Trigger an event.
The name of the event.
Arguments to pass to event handlers.
The extract
utility deletes a property from an object and returns its
value.
The object that owns the property
The name of the property to extract
The value of the property
Extract the text nodes from a virtual element.
The formatNumber
utility localizes a number into a string with the
appropriate punctuation based on the provided locale otherwise will default to the users locale.
The humanTime
utility converts a date to a localized, human-readable time-
ago string.
Returns if the passed value is an object.
In this context, "object" refers to any non-primitive value, including arrays, function, maps, dates, and more.
The liveHumanTimes
initializer sets up a loop every 1 second to update
timestamps rendered with the humanTime
helper.
The mapRoutes
utility converts a map of named application routes into a
format that can be understood by Mithril, and wraps them in route resolvers
to provide each route with the current route name.
The mixin
utility assigns the properties of a set of 'mixin' objects to
the prototype of a parent object.
The class to extend the new class from.
The objects to mix in.
A new class that extends Parent and contains the mixins.
Mithril 2 does not completely rerender the page if a route change leads to the same route (or the same component handling a different route). This util calls m.route.set, forcing a reonit.
Convert the given string to a unique color.
Check if class A is the same as or a subclass of class B.
An event handler factory that makes it simpler to implement data binding for component event listeners.
The handler created by this factory passes the DOM element's attribute identified by the first argument to the callback (usually a bidirectional Mithril stream: https://mithril.js.org/stream.html#bidirectional-bindings).
Replaces m.withAttr for Mithril 2.0.
Generated using TypeDoc version 0.22.10
The username/email