Closed vreality64 closed 7 years ago
@VReality64 Thank you for your report. I am going to anwser it soon. 😄
I think that This case is very important issue. Sometimes Component has not to fire event. So if trigger add option like boolean for event fire condition. I think differently It is duplicate feature(stop
method). So. It need more idea.
Issue moved to naver/egjs-component #19 via ZenHub
I'll mention 3 things.
Situation I been through
I have one controller and two modules. everything is class inherited from
eg.Component
.I tried handle custom event state between modules and controller using
customEvent.stop()
function. But stop was not worked.Here are code.
The thing what I expected
Code describes that if controller calls
event.stop()
then doesn't executemoduleB.select()
. becausestop()
makestrigger
returnfalse
.I think reusing custom event is common case. normally custom event has data, so it was broadcasted to system.
But when it reused,
isCanceled
variable was overridden.If intended, it is notable.
Solution
I changed middle module. not re-used event object
I made JS fiddle example. you can reproduce my situation.
Question
I can't sure what is right, so just want to know decision history. what philosophy / thoughts leads this conclusion?