edge / account

Account portal for managing Edge services
Other
3 stars 1 forks source link

Refactor 'update-entity' emit events to supply replacement data #270

Open annybs opened 4 months ago

annybs commented 4 months ago

Example: https://github.com/edge/account/pull/269/commits/7f2e7071f3dffe61e5eda3ad91fd4c83d0ad2ad4

This emit sequence allows a nested component to trigger a reload of server data after the server has been changed. However, there is some redundancy here, because while server is received in the response data for the changed, it isn't passed back to the parent component to substitute; instead, a subsequent GET request is triggered.

We can reduce round trips by refactoring events in several places to allow response data to be passed up the component tree. The API provides consistent response entity data for almost all requests, so very little if anything needs to be done in the backend to make this happen.

This goes hand-in-hand with #238 to reduce avoidable traffic to the API and improve performance.