events

<script src="./point_src/events"></script>

The Events class and the automatically prepared events object, provides a simple interface to event listen and dispatch

events.on('stage:prepare', (e)=>console.log(e))
events.emit('eventname', { foo: 'bar' })

When loading this events module, the Stage automatically inherits StageEvents live functionality. all standard interface events are applied:

class MyStage extends Stage {
    autoListen = true

    onClick(ev){
        // raw ev event
    }
}

To extend this, prefix any event with on, e.g. DragOver, becomes onDragOver. Function casing is ignored, ensuring onDragOver is the same as ondragover.

Meta Data
filepath_exists True
path events
filepath events.js
clean_files ()

  • ClassDeclaration
    class comments:

    The base Event class, foremitonon` methods.

    Object events exists in this events module.

    • constructor

      constructor

      (
      parent = undefined
      )
      from Events
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      The base Event class, foremitonon` methods.

      Object events exists in this events module.

    • method

      emit

      (
      name , detail
      )
      from Events
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    • method

      on

      (
      name , handler , props
      )
      from Events
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    • method

      getParent

      (
      )
      from Events
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • VariableDeclaration
    const

    events

    =
    new Events ( this )
  • FunctionDeclaration
    function

    getMethodsOf

    (
    obj
    )
    dict_keys(['kind', 'word', 'generator', 'expression', 'async', 'params', 'id', 'pos', 'type'])
  • EmptyStatement
    ; (empty statement)
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])
  • ClassDeclaration
    class comments:

    StageEvents apply .events to the stage. If autoListen=true (default). any method matching on[EventName] is hooked.

    class MyStage extends Stage {
        autoListen = true
    
        onClick(ev){
            // raw ev event
        }
    }
    

    Standard on and emit (listen/dispatch) for events:

    stage.on('eventName', stage.handle)
    
    • property

      autoListen

      = true
      from StageEvents
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos', 'class_name'])
    • constructor

      constructor

      (
      stage = undefined
      )
      from StageEvents
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    • method

      wake

      (
      )
      from StageEvents
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    • method

      getAutoListen

      (
      )
      from StageEvents
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    • method

      hook

      (
      entity
      )
      from StageEvents
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      console.log('Auto listen.')

    • method

      on

      (
      name , handler , props
      )
      from StageEvents
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    • method

      emit

      (
      name , detail
      )
      from StageEvents
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    • method

      getEventParent

      (
      )
      from StageEvents
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    • method

      receiverFunction

      (
      prop
      )
      from StageEvents
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      console.log('prop', prop, handler)

    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • VariableDeclaration
    const

    stageHandler

    =
    function ( parent )

    debugger;

  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])