API Docs for:
Show:

ResolvableActionInterface Class

Surface API to handle ResolvableAction implementations. This allows a source object and target object to have separate action resolution logic without directly referencing eachother. See also PerformableActionInterface, PerformableAction

Methods

canResolveAction

(
  • action
  • source
  • [settings]
)
Boolean

Checks if a target can resolve an action with given source and settings. this is the target.

Parameters:

  • action String
    • The action being performed on this target to resolve.
  • source Object
    • The source object performing the action on this target.
  • [settings] Object optional
    • Settings for the action.

Returns:

Boolean:

true if action was successfully resolved

performAction

(
  • action
  • source
  • [settings]
)
Boolean

Resolves an action on target from source with given settings.

Parameters:

  • action String
    • The action being performed on this target to resolve.
  • source Object
    • The source object performing the action on this target.
  • [settings] Object optional
    • Settings for the action.
    • [skipCanResolveAction] Object optional
      • If true skips checking that this.skipCanResolveAction(action, source, settings) == true

Returns:

Boolean:

true if the action was successfully resolved.

setResolvableAction

(
  • action
  • [implementation]
)

Sets a resolvable action implementation on object.

Parameters:

  • action String
    • The action name.
  • [implementation] ResolvableAction optional
    • Object to set as the action implementation.