Beagle v1.6 is no longer actively maintained. The documented version you are viewing may contain deprecated functionality. For up-to-date documentation, see the latest version .
What are they? Events are anything that can trigger actions on Beagle (Beagle Actions). In the JSON, every key is associated to a Beagle Action that represents an event.
See some events example:
An event can be part of the component contract or a Beagle action. Abutton
, for example, is a component onPress
and is an event that it is part of its contract. An action sendRequest, it’s an example of action in which the events “onSuccess”, “onError” and “onFinish” are part of the contract.
See the example with the event onPress button:
Button(
text = "Click to show message",
onPress = listOf(
Alert(
title = "I'm an alert",
message = "Hello Beagle"
)
)
)
The example above associates the action “beagle:alert” to the event onPress of the beagle:button component. When you press the button where the title is “Click to show message”, a message will be shown on the screen with the text “Hello World!”.
Every event in any component or action can be associated with any Beagle Action. An alert action was used in the previous example, but any other can be used. To make a request when clicking the button, the action “beagle:sendRequest” could be used. For more information about all available actions, access here.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.