Skip to content

Latest commit

 

History

History
91 lines (64 loc) · 1.46 KB

how-to-use.md

File metadata and controls

91 lines (64 loc) · 1.46 KB

How to use

Example

import actionsInteractor, {Types} from 'actions-interactor';
interactor = actionsInteractor.create({
  name:'My interactor',
  description:'My description'
})

console.log(interactor);
// {
//   name:'My interactor',
//   description:'My description',
//   actions:[]
// }

interactor.addAction({
  name:'Name'
  description:'Description',
  type: Types.ACTION_BASE
})

API

create(interactor: object) : Interactor

interactor object :

  • name: String
  • description: String,
  • actions: Action[]
import {Types} from 'actions-interactor';
  • ACTION_BASE:
    • name: String
    • description: String
  • ACTION_INPUT: as ACTION_BASE plus
    • required: Boolean
    • defaultValue: String
  • ACTION_COMBO: as ACTION_BASE plus
    • required: Boolean
    • choices: Array

Classes

Attributes

  • name: String
  • description: String
  • actions: Action[]

Functions

isValid(): boolean

Return true if all actions are valid.

addAction(obj: Object)

Add an action to the list of actions

obj :

  • name: String
  • description: String
  • type: ACTION_TYPE
  • required: Boolean
  • defaultValue: String,
  • choices: Array

Attributes

  • name: String
  • description: String

Functions

isValid(): boolean

Return true if all actions are valid.