You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The aim is to simplify the API used by client developers still further by using getters and setters for synchronous updates to object properties, and by treating actions as object methods that return promises. The client platform should validate data and thrown an exception if the app tries to pass a value that is invalid in respect to the thing description. Asynchronous errors are reported via events, e.g. loss of connection or an error reported by the server, but note that actions are asynchronous and the app should deal with errors through the promise returned when invoking an action. We need to agree on a means to separate the system events from the events declared in thing descriptions. One idea is by event name, but another idea would be to an API for subscribing to system events, e.g. to set onerror handlers. The error pattern is common place for node and for the browser DOM.
The text was updated successfully, but these errors were encountered:
One complication is how to get the model given a thing. One idea is to reserve part of the name space for object properties, e.g. all properties whose name starts with "@", this thing["@model"] would provide the model for the thing. My plan is to layer all this on top of the platform abstraction API, e.g. a setter for a thing's property would first validate value against the thing description, then call the thing's platform's write method which returns a promise. If the promise is rejected, this would be used to notify a system event.
How many events need to be defined?
errors for property read and write - in most cases, client-side data validation should avoid these errors
unexpected loss of connectivity and restoration of connectivity
invalid bearer token, e.g. where a previously valid token has expired or been revoked
updates to metadata and to the declarations for properties, actions and events
The aim is to simplify the API used by client developers still further by using getters and setters for synchronous updates to object properties, and by treating actions as object methods that return promises. The client platform should validate data and thrown an exception if the app tries to pass a value that is invalid in respect to the thing description. Asynchronous errors are reported via events, e.g. loss of connection or an error reported by the server, but note that actions are asynchronous and the app should deal with errors through the promise returned when invoking an action. We need to agree on a means to separate the system events from the events declared in thing descriptions. One idea is by event name, but another idea would be to an API for subscribing to system events, e.g. to set onerror handlers. The error pattern is common place for node and for the browser DOM.
The text was updated successfully, but these errors were encountered: