Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Mediator already exists  (Read 5355 times)
jgervin
Courseware Beta
Sr. Member
***
Posts: 50


View Profile Email
« on: March 30, 2009, 11:54:59 »

If a mediator and proxy already exist for viewComponent will a call to facade.registerMediator create another one and destroy the old one or will it just pull back the old one?

Is it better to do something like

if( facade.retrieveMediator( "mymediatorname" ) ){
 // do nothing skip creating a new one.
}
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: March 30, 2009, 03:53:36 »

It will not register the new mediator or proxy if there is already one registered with the same name.

If you are concerned that you may not have removed a Mediator or Proxy then use facade.hasMediator or facade.hasProxy to check first.

-=Cliff>
Logged
Pages: [1]
Print