- From: Mark Watson <watsonm@netflix.com>
- Date: Thu, 17 Mar 2011 10:32:57 -0700
- To: "public-device-apis@w3.org" <public-device-apis@w3.org>
Received on Thursday, 17 March 2011 17:33:31 UTC
All, The System Information API makes extensive use of callback objects and one thing about these is confusing me. The callback parameters have a custom type, such as SuccessCB, ErrorCB. These types are defined as having specific methods, such as onSuccess and onError. However, in the examples, such as the example in 4.4, a function "success" is defined and it is this function that is supplied as the argument (in this case to the monitor method). How is it that the success function is compliant to the SuccessCB interface, which has the method onSuccess ? The model shown in the examples seem to be very much how one would want to program, perhaps more commonly using an anonymous function for the callback. Apologies in advance if this is actually just an ECMAScript question! Regards, Mark Watson
Received on Thursday, 17 March 2011 17:33:31 UTC