src/client-registry.js
function register(client) {
  const appId = client.appId;
  if (registry[appId] && !registry[appId].isDestroyed) {
    registry[appId].destroy();
  }
  registry[appId] = client;

  defer(() => listeners.forEach(listener => listener(client)));
}
function register(client) {
  const appId = client.appId;
  if (registry[appId] && !registry[appId].isDestroyed) {
    registry[appId].destroy();
  }
  registry[appId] = client;

  defer(() => listeners.forEach(listener => listener(client)));
}
function register ( client ) { const appId = client . appId ; if ( registry [ appId ] && ! registry [ appId ] . isDestroyed ) { registry [ appId ] . destroy ( ) ; } registry [ appId ] = client ; defer ( ( ) => listeners . forEach ( listener => listener ( client ) ) ) ; }
Register a new Client; will destroy any previous client with the same appId.

@method register
@param  {layer.Client} client
Register a new Client ; will destroy any previous client with the same appId .