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 way the current specification is defined, a developer would call isRegistered and, if the application is already registered, they then call register to obtain the endpoint. The problem I see is that this results in a redundant query to local storage, one to check if the record exists (which is thrown away), and then, in most cases, one to obtain the record.
If we made it so that isRegistered returned the result of that query rather than true/false, it would still perform the service of checking to see if the endpoint already exists, but then it would save the developer from having to call register() regardless of the result. This has the added bonus of making the call to register() be more accurately descriptive, since it would only be used if you weren't already registered, and it would be used to perform the act of registration.
I suppose this implementation would also imply a name change from isRegistered to getRegistration or something.
The text was updated successfully, but these errors were encountered:
The way the current specification is defined, a developer would call isRegistered and, if the application is already registered, they then call register to obtain the endpoint. The problem I see is that this results in a redundant query to local storage, one to check if the record exists (which is thrown away), and then, in most cases, one to obtain the record.
If we made it so that isRegistered returned the result of that query rather than true/false, it would still perform the service of checking to see if the endpoint already exists, but then it would save the developer from having to call register() regardless of the result. This has the added bonus of making the call to register() be more accurately descriptive, since it would only be used if you weren't already registered, and it would be used to perform the act of registration.
I suppose this implementation would also imply a name change from isRegistered to getRegistration or something.
The text was updated successfully, but these errors were encountered: