CenterForDigitalHumanities / CenterForDigitalHumanities/deer
Event System
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
This is in relation to the Web Component architecture which may have a better way to sync up with an Event system.
We currently have the following events
```
EVENTS: {
CREATED: "deer-created",
UPDATED: "deer-updated",
LOADED: "deer-loaded",
NEW_VIEW: "deer-view",
NEW_FORM: "deer-form",
VIEW_RENDERED : "deer-view-rendered",
FORM_RENDERED : "deer-form-rendered",
CLICKED: "deer-clicked"
}
```
This system has some problems.
- `deer-created` announces when the Entity of a form is created. This kind of event should instead of tied to the success of the entire submit process, which should include the Annotations generated by the form inputs for the Entity.
- `deer-updated` is a tricky syntax. It fires after all the Annotations of a form are generated or updated. This happens during Create and Update scenarios, which is confusing. This kind of event should only fire when _updating_ an entity fully completes.
- `deer-view` and `deer-form` are ambiguous and should be clearly separate from `deer-view-rendered` and `deer-form-rendered`. This kind of event is available to the front end developers who need to register a new programmatically generated form or view with DEER for the DOM.
- `deer-form-rendered` and `deer-view-rendered` are generally how we would like them. However, they "double up" and fire after creates and updates as things are re-rendered. Page load and re-rendering need to be separate scenarios.
Contributor guide
Assessment
This issue has not been assessed yet.