Class: share.CommonComponentBase

Defined in: base.coffee
Inherits: BlazeComponent

Overview

A common base class for both CommonComponent and CommonMixin.

Direct Known Subclasses

CommonComponent CommonMixin

Instance Method Summary

Instance Method Details

# (SubscriptionHandle) subscribe(name, args...)

A version of subscribe which logs errors to the console if no error callback is specified.

Returns:

  • SubscriptionHandle

# (BlazeComponent) ancestorComponent(nameOrComponent)

Traverses the components tree towards the root and returns the first component which matches the provided component name, class, or instance.

Returns null if such component is not found.

It returns a strict ancestor, it does not check the component itself first.

Parameters:

  • nameOrComponent ( String, Class<BlazeComponent>, BlazeComponent )

Returns:

  • BlazeComponent

# (BlazeComponent) ancestorComponentWith(propertyOrMatcherOrFunction)

Traverses the components tree towards the root and finds the first component which matches a propertyOrMatcherOrFunction predicate.

Returns null if such component is not found.

A propertyOrMatcherOrFunction predicate can be:

  • a property name string, in this case the first component which has a property with the given name (or its mixins do) is matched
  • a matcher object specifying mapping between property names and their values, in this case the first component which (or its mixins) has all properties from the matcher object equal to given values is matched (if a property is a function, it is called and its return value is compared instead)
  • a function which receives (ancestor, component) with this bound to component, in this case the first component for which the function returns a true value is matched

It returns a strict ancestor, it does not check the component itself first.

Parameters:

  • propertyOrMatcherOrFunction ( String, Object, Function )

Returns:

  • BlazeComponent

# (anything) callAncestorWith(propertyName, args...)

Traverses the components tree towards the root and finds the first component (or its mixin) with a property propertyName, and if it is a function, calls it with args arguments, otherwise returns the value of the property.

Returns undefined if such component is not found.

It calls a strict ancestor, it does not check the component itself first.

Parameters:

  • propertyName ( String )

Returns:

  • anything

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: