Skip to content

Template which is used to init new skripio component repo.

Notifications You must be signed in to change notification settings

fmecgroup/skripio-component-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skripio logo

js-semistandard-style Conventional Commits

About

Template to init new skripio component repo.

This template contains all necessary assets and build tools as well as config files to quickly start creating a new skripio component.

See CONTRIBUTEJS.MD for details on how to develop new skripio component.

Reference

Table of Contents

skripio

skripio namespace

initObject

skripio.initObject function
Creates a Component instance.

Parameters

  • objectName string Component instance name.

  • initOptions string Init options object (stringified).

    • initOptions.componentOptions object Component constructor options.
  • callback any 1C callback identifier of this wrapper function.

Returns string

  • sync payload Instantiated Component object name and DOM element id which will receive async responses from this object will be returned
  • async payload None

runObjectMethod

skripio.runObjectMethod function
Executes given Component instance method.

Parameters

  • object string Component instance name.
  • method string Component instance method name.
  • methodArgs string Component method arguments (stringified).
  • callback any 1C callback identifier of this function.

Returns any

  • sync payload See component method docs
  • async payload See component method docs

Component

Component class
An object of this class is instantiated by the skripio.initObject function.

Parameters

  • componentOptions object Constructor options interface object.

    • componentOptions.undefined
    • componentOptions.undefined

Returns string

  • sync payload None
  • async payload None

asyncMethod

asyncMethod Component method
Returns result asynchronously after given timeout.

Parameters

  • args object Method arguments object.

    • args.message string Message text. (optional, default 'Hi from async method after timeout!')
    • args.timeout string Emit timeout. (optional, default 1200)
    • args.callback string 1C callback identifier. (optional, default 'asyncMethod')

Returns string

  • sync payload None
  • async payload Message passed

syncMethod

syncMethod Component method
Returns result synchronously.

Parameters

  • args object Method arguments object.

    • args.message string Message text. (optional, default 'Hi from sync method!')
    • args.callback string 1C callback identifier. (optional, default 'syncMethod')

Returns string

  • sync payload Message passed
  • async payload None