Guides
Binding Actions
Use bindings when resolved intents should trigger explicit application logic instead of relying only on standard DOM execution.
Need the shortest path?
Use Quick Start when you want the smallest working route → scan → graph → run flow first.
Something feels off?
Inspect scan output, graph state, active route/context, and dispatch in a practical order.
Need the full surface?
Browse all runtime methods, hooks, extension points, and lifecycle APIs.
Bindings let the runtime call application-specific logic for routes, actions, fields, filters, and outputs.
Basic binding
ts
3 lines
Cinder.bind('action', 'save', ({ intent, snapshot }) => {
console.log(intent.target, snapshot.runtime.activeContextId);
});When to use bindings
Use bindings when:
- the app needs custom state updates
- a route or action is not represented by a clean DOM interaction
- you want explicit control over side effects
- tag-only DOM execution is not the right fit for that target
When DOM execution may be enough
The current runtime already supports many standard DOM paths, including:
- anchor/path navigation
- input/select/textarea updates
- checkbox and radio behavior
- form submit flows
- action clicks
- output reveal/focus behavior
So bindings should usually be the second step, not the first one.
Cleaning up bindings
Use Cinder.unbind() when a binding should no longer participate in dispatch.
ts
1 line
Cinder.unbind('action', 'save');Related pages
Continue reading