This repository was archived by the owner on Jun 1, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Event Aggregator Use Cases
Ghislain B edited this page Jan 30, 2020
·
6 revisions
A typical use case is to use the Event Aggregator as a global pub/sub (publish/subscribe). A user would typically send (publish) data (which could be any type of data) with a key identifier which is used as a Singleton Service.
// Child (sending user form)
import { EventAggregator } from 'aurelia-event-aggregator';
@inject(EventAggregator)
export class HelloChild{
constructor(private ea: EventAggregator) { }
save(user) {
this.ea.publish('form:saved', user);
}
}// Parent (listening to user form)
import { EventAggregator, Subscription } from 'aurelia-event-aggregator';
@inject(EventAggregator)
export class HelloParent {
subscription: Subscription;
constructor(private ea: EventAggregator) {
this.subscription = this.ea.subscribe('form:saved', (user) => alert(`Hello ${user.firstName}`));
}
dispose() {
// don't forget to dispose of the subscription to avoid any side effect
this.subscription.dispose();
}
}Contents
- Aurelia-Slickgrid Wiki
- Installation
- Styling
- Interfaces/Models
- Testing Patterns
- Column Functionalities
- Global Grid Options
- Localization
- Events
- Grid Functionalities
- Auto-Resize / Resizer Service
- Resize by Cell Content
- Add/Delete/Update or Highlight item
- Dynamically Change Row CSS Classes
- Column Picker
- Composite Editor Modal
- Context Menu
- Custom Tooltip
- Excel Copy Buffer
- Export to Excel
- Export to File (CSV/Txt)
- Grid Menu
- Grid State & Presets
- Grouping & Aggregators
- Header Menu & Header Buttons
- Header Title Grouping
- Pinning (frozen) of Columns/Rows
- Row Colspan
- Row Detail
- Row Selection
- Tree Data Grid
- SlickGrid & DataView objects
- Addons (controls/plugins)
- Backend Services