Exemple #1
0
 public void unsubscribe(RouteAware routeAware)
 {
     D.assert(routeAware != null);
     foreach (R route in this._listeners.Keys) {
         HashSet<RouteAware> subscribers = this._listeners[route];
         subscribers?.Remove(routeAware);
     }
 }
Exemple #2
0
 public void subscribe(RouteAware routeAware, R route)
 {
     D.assert(routeAware != null);
     D.assert(route != null);
     HashSet<RouteAware> subscribers = this._listeners.putIfAbsent(route, () => new HashSet<RouteAware>());
     if (subscribers.Add(routeAware)) {
         routeAware.didPush();
     }
 }