Closed QingAn closed 2 years ago
@Sharonzd, @MichaelWangzitao
As discussed during last week WG call. Please take a look.
I reviewed this PR, and basically, I agree to merge it to address #30 . In addition, I suggest adding the interaction process between the event handler and attributes. For example, when the event "ongloballaunched" is triggered, "globalState" should be set to "launched".
I totally agree to change callbacks to events. From another perspective, this would make related code together, which This conforms to some code design principles like high cohesion. But we maybe need some examples of how to listen handlers? Like Page.registerLifeCycle( 'hide', hideEventHandler)
@Sharonzd
I totally agree to change callbacks to events.
Thanks for reply.
From another perspective, this would make related code together, which This conforms to some code design principles like high cohesion. But we maybe need some examples of how to listen handlers? Like Page.registerLifeCycle( 'hide', hideEventHandler)
I agree. By looking at other related spec like Page Lifecycle, I am thinking of the example like:
const doGlobalLaunched = (inputObject) => {
console.log(inputObject.pagePath);
};
global.addEventListener('global launched', doGlobalLaunched);
@MichaelWangzitao
I reviewed this PR, and basically, I agree to merge it to address #30 .
Thanks for reply.
In addition, I suggest adding the interaction process between the event handler and attributes. For example, when the event "ongloballaunched" is triggered, "globalState" should be set to "launched".
How about the wording like this: The ongloballaunched attribute is an event handler IDL attribute for the initialization event type. Once ongloballaunched is triggered, globalState will be set to launched.
@MichaelWangzitao
I reviewed this PR, and basically, I agree to merge it to address #30 .
Thanks for reply.
In addition, I suggest adding the interaction process between the event handler and attributes. For example, when the event "ongloballaunched" is triggered, "globalState" should be set to "launched".
How about the wording like this: The ongloballaunched attribute is an event handler IDL attribute for the initialization event type. Once ongloballaunched is triggered, globalState will be set to launched.
Agree!A brief description is good.
Related to #30
Preview | Diff