Shared publicly  - 
 
More information about the proposal to switch to an object literal syntax which will allow us to iterate on the API more freely.
 
In late March +Greg Billock announced a proposal to change the constructor of the `Intent` object. The change is important because as more use-cases arrive such as default and explicit intents, we found that adding more and more parameters to the constructor made for a mess of "undefined" values in a constructor invocation for optional parameters.

The proposal changes the original syntax from:
var x = new Intent("http://webintents.org/view", "schema.org/Person", person);
to:
var x = new Intent({"action": "http://webintents.org/view",
"type": "schema.org/Person",
"data": person});
W3C home > Mailing lists > Public > public-web-intents@w3.org > March 2012. Proposal to switch to an object-literal Intent constructor. This message : [ Message body ] [ Respond ] [ More o...
6
1
James McGill's profile photoDan Brickley's profile photoWeb Developers Sandbox's profile photo
 
This is an incredibly sensible proposal. If there is one thing I have learned as a Javascript API developer, it is that this is the correct way to format API constructors.
Add a comment...