Skip to content

Latest commit

 

History

History
94 lines (68 loc) · 1.23 KB

built-in-actions.md

File metadata and controls

94 lines (68 loc) · 1.23 KB

Update

The update action allows us to update a property of a component.

Args

  1. component property in the format [component name].[property]
  2. the new value

Example

"onClick": [ { "fn": "update", "args": ["nav.label", "Jaseci 2.0"], } ]

Alert

Runs the browser alert function.

Args

  1. alert message

Example

"onClick": [
    {
        "fn": "add",
        "args": [1, 3],
    }
]

Call Endpoint

Runs the browser alert function.

Properties

  • endpoint - the api url that will be called

Args

  1. HTTP Verb
  2. Request body

Example

"onClick": [
        {
            "fn": "callEndpoint",
            "endpoint": "http://localhost:3334/message",
            "args": [
                "POST",
                {
                    "message": "Hello!"
                }
            ]
        }
]

Append

Adds a component as a child of another component.

Args

  1. component name
  2. component structure - the child component

Example

"onClick": [
    {
        "fn": "append",
        "args": ["msgs",
            {
                "component": "Text",
                "props": {
                    "value": "Hello"
                }
            }
        ],
    }
]