Implementing custom functionality
To implement custom functionality, the system provides two ways of implementing custom behavior:
- Custom functions
- Elm-style messages and update functions
Messages and Update Functions
Creating New Messages
- Locate the Messages element in your canvas
- Click the "New Message" button to create a message
- The system will automatically:
- Create a new message with default name
NewMessageX - Add corresponding case to the update function with default implementation
- Add the message to available event handlers
Modifying Update Function
For each message, you can modify how it updates the model:
// Example update function for a message
return {
...model, // the existing model
Count: model.Count + 1, // Update specific fields
};
The update function receives:
- model: Current application state
- event: Browser event that triggered the message
- msg: The message type that was dispatched
Attaching Messages to Elements
- Select an element in the ViewElement canvas
- Open the Event Handlers menu
- Choose an event type (e.g. "onClick")
- Select your message from the handler dropdown
- Click "Add Handler" to attach

Example element with message handler:
Preview Changes
You can test your custom functionality by:
- Clicking "Run application" in the ViewElement toolbar
- Interacting with the elements in preview mode
- Observing model updates in real-time
The system will execute your update functions and re-render the UI automatically when messages are dispatched.