Manage Mirador state with actions and store
mainMirador uses a Redux-like pattern to manage state and perform operations. You interact with the viewer instance via actions to dispatch changes to the store.
Common tasks include:
- Adding a window:
store.dispatch(actions.addWindow()) - Focusing a window:
store.dispatch(actions.focusWindow('window-id')) - Checking current state:
store.getState()
// Add a window
store.dispatch(actions.addWindow());
// Focus a specific window
store.dispatch(actions.focusWindow('window-1'));
// Check current state
const state = store.getState();