AbstractPureComponent 

The base class for all pure (state-less) view components.

Unlike the “regular” components, pure components do not have any external state, and therefore are pure functions of their props and state. This allows for some nice optimizations on react’s part (see the link).

Because of this, this class does not provide all the APIs provided by the {@linkcode AbstractComponent} class (e.g. listen) as there is next to none use of them with pure components.

Kind: global abstract class
See: https://facebook.github.io/react/docs/react-api.html#react.purecomponent


new AbstractPureComponent(props, context) 

Initializes the component.

Param Type Description
props Object.<string, \*> The component properties.
context Object.<string, \*> The component context.

abstractPureComponent._utils : Object.<string, \*> 

The view utilities, initialized lazily upon first use from either the context, or the component’s props.

Kind: instance property of AbstractPureComponent


abstractPureComponent.utils ⇒ Object.<string, \*> 

Returns the utilities for the view components. The returned value is the value bound to the $Utils object container constant.

Kind: instance property of AbstractPureComponent
Returns: Object.<string, \*> - The utilities for the view components.


abstractPureComponent.localize(key, [params]) ⇒ string 

Returns the localized phrase identified by the specified key. The placeholders in the localization phrase will be replaced by the provided values.

Kind: instance method of AbstractPureComponent
Returns: string - Localized phrase.

Param Type Description
key string Localization key.
[params] Object.<string, (number\|string)> Values for replacing the placeholders in the localization phrase.

abstractPureComponent.link(name, [params]) ⇒ string 

Generates an absolute URL using the provided route name (see the app/config/routes.js file). The provided parameters will replace the placeholders in the route pattern, while the extraneous parameters will be appended to the generated URL’s query string.

Kind: instance method of AbstractPureComponent
Returns: string - The generated URL.

Param Type Description
name string The route name.
[params] Object.<string, (number\|string)> Router parameters and extraneous parameters to add to the URL as a query string.

abstractPureComponent.cssClasses(classRules, includeComponentClassName) ⇒ string 

Generate a string of CSS classes from the properties of the passed-in object that resolve to true.

Kind: instance method of AbstractPureComponent
Returns: string - String of CSS classes that had their property resolved to true.

Param Type Default Description
classRules string | Object.<string, boolean>   CSS classes in a string separated by whitespace, or a map of CSS class names to boolean values. The CSS class name will be included in the result only if the value is true.
includeComponentClassName boolean false  

Example

this.cssClasses('my-class my-class-modificator', true);

Example

this.cssClasses({
           'my-class': true,
           'my-class-modificator': this.props.modificator
       }, true);

abstractPureComponent.fire(eventName, [data]) 

Creates and sends a new IMA.js DOM custom event from this component.

Kind: instance method of AbstractPureComponent

Param Type Default Description
eventName string   The name of the event.
[data] \* Data to send within the event.

abstractPureComponent.listen(eventTarget, eventName, listener) 

Registers the provided event listener for execution whenever an IMA.js DOM custom event of the specified name occurs at the specified event target.

Kind: instance method of AbstractPureComponent

Param Type Description
eventTarget React.Element | EventTarget The react component or event target at which the listener should listen for the event.
eventName string The name of the event for which to listen.
listener function The listener for event to register.

abstractPureComponent.unlisten(eventTarget, eventName, listener) 

Deregisters the provided event listener for an IMA.js DOM custom event of the specified name at the specified event target.

Kind: instance method of AbstractPureComponent

Param Type Description
eventTarget React.Element | EventTarget The react component or event target at which the listener should listen for the event.
eventName string The name of the event for which to listen.
listener function The listener for event to register.