-
Notifications
You must be signed in to change notification settings - Fork 20
Remote responses
Other times when we’ve built UI’s that have to communicate with a remote server, each component - usually with the use of a “controller” - would request whatever data they needed. Handling requests this way makes it very easy to do any request and handle any type of response. When using om.next the UI component doesn’t know anything about the remote server. It can only do remote requests by transacting om.next mutations
, which is expressed with a data structure. Each mutation
in om.next declare whether it should go remote or not (and which remote it should go to), so the remote communication is abstracted away from the UI, making it non-obvious how to handle responses for a specific mutations for a specific UI component.
To get back the power of being able to wait for responses synchronously (blocking UI until response is back), we tag each action with an ID and wait for that ID to respond from the server. We've created a namespace for using these messages this which is eponai.client.parser.message
.
.