Skip to content

Latest commit

 

History

History
118 lines (101 loc) · 3.27 KB

Logic.md

File metadata and controls

118 lines (101 loc) · 3.27 KB

@squirrel-forge/ui-util

Back to table of contents

Documentation

Javascript / Logic

Layout <[ Logic ]> Number

Table of contents


Config

Config class - A class for holding configuration data, with defaults and inheritance extension

Class overview

class Config {
  static clone( data ) {} // Object|Array
  static merge( data, target, extend = false ) {} // void
  static extendInheritance( extended ) {} // null|Object
  constructor( defaults = {}, extended = [] ) {}
  defaults : Object
  data : Object
  exposed : Object
  get( name ) {} // *
  set( name, value ) {} // void
  merge( data, extend = false ) {} // void
  require( ...names ) {} // Array
}

For more details check the Config source file.


Plugin

Plugin class - Plugin class for use with the Plugins class

Class overview

class Plugin {
  constructor( options = {}, context = null, debug = null ) {}
  options : Object
  debug : null|Console
  context : null|Object
  _context_check( context ) {} // void
}

For more details check the Plugin source file.


Plugins

Plugins class - A plugins handler class for use with the Plugin class

Class overview

class Plugins {
  constructor( plugins = [], context = null, append = true, debug = null ) {}
  append : null|Boolean
  debug : null|Console
  context : null|Object
  load( plugins ) {} // void
  init( Construct, options = {}, replace = false ) {} // Object
  runAsync( method, params = [], restrict = null ) {} // Promise[]
  run( method, params = [], restrict = null ) {} // Object
  exec( name, method, params = [], silent = false ) {} // *
  get( name ) {} // null|Object
  has( name ) {} // boolean
}

For more details check the Plugins source file.


Tracker

Tracker class - A tracking helper class width condition and dynamic data

Class overview

class Tracker {
    static getData( tracker, params ) {} // TrackingData|Object
    constructor( executor = null, debug = null ) {}
    debug : null|Console
    run( trackers, params = [] ) {} // void
    ranOnceAlready( tracker, params = [] ) {} // boolean
    clearOnce( group = null ) {} // void
}

For more details check the Tracker source file.

Examples

How to run a tracker.

tracker.run( [
    {
        trigger : ( tracker, arg1, arg2 ) => { return arg1 === 'argument'; },
        once : 'event_name',
        group : ( tracker, arg1, arg2 ) => {
            return arg1 + arg2;
        },
        data : {
            event : 'event_name',
            dynamic : ( tracker, arg1, arg2 ) => {
                return arg1.length + arg2.length;
            },
        },
    },
], [ 'argument', 'argument...' ]);

Check the UiVideoPluginTracking class plugin of the UiVideoComponent for an implementation example.


Layout <[ Logic ]> Number