public static void Unsubscribe <T>(Action <T> handler) { Subscriber anonymousSubscriber = new AnonymousSubscriber <T>(handler); subscribers.TryRemove(anonymousSubscriber.GetHashCode(), out anonymousSubscriber); }
public static void Subscribe <T>(Action <T> handler) { var anonymousSubscriber = new AnonymousSubscriber <T>(handler); subscribers.TryAdd(anonymousSubscriber.GetHashCode(), anonymousSubscriber); }