Events and Synchronization

Keep views synchronized when data changes using EventBus and SignalR.


Overview

Two communication systems:

  • EventBus - In-browser event communication between components

  • SignalR - Real-time updates from Lucy server


EventBus

Subscribe to and publish events within your app.

Basic Usage

import { useEventSubscriber } from "uxp/components";

const LocationList = () => {
    const refreshList = () => {
        // Refresh the list
    };

    // Subscribe to event
    useEventSubscriber('location:refresh', refreshList);

    return <div>...</div>;
};

Publishing Events

With Data


SignalR Real-Time Updates

Receive real-time updates from Lucy server.

Basic Usage

Note: SignalR messages are published from Lucy. Frontend components can only subscribe to these messages, not publish them.


Cleanup

Subscriptions auto-cleanup when component unmounts. No manual cleanup needed:


See Location 5.0 app (/Location/5.0/Resources/views/src/) for complete event synchronization examples.


Next Steps

Last updated