DoclerLabs / hexMachina

Releases, issues, documentation, website of hexMachina, framework written in Haxe
http://hexmachina.org
MIT License
44 stars 8 forks source link

Listen service broken if it is map-type #196

Closed aliokan closed 7 years ago

aliokan commented 7 years ago

1° module2.onUpdate receive event

<service id="myService" type="mock.MockService" />
<module id="module2" type="mock.MockModule">
    <listen ref="myService">
        <event static-ref="mock.MockMessage.EVENT" method="onUpdate"/>
    </listen>
</module>

JS output :

myService.addHandler(mock_MockMessage.EVENT,$bind(module2,module2.onUpdate));

2° module2.onUpdate never receive event

But if I add map-type on myService, addHandler is done on ApplicationDomainDispatcher and not on myService

<service id="myService" type="mock.MockService" map-type="mock.IMockService"/>
<module id="module2" type="mock.MockModule">
    <listen ref="myService">
        <event static-ref="mock.MockMessage.EVENT" method="onUpdate"/>
    </listen>
</module>

JS output :

hex_domain_ApplicationDomainDispatcher.getInstance().addHandler(mock_MockMessage.EVENT,module2,$bind(module2,module2.onUpdate),__domainName_myService);