SubscriptionDeduplicator
Deduplicates subscription notifications with the same state. The state
can be of any class, allowing NSNumber-wrapped values.
It’s an immutable class.
Methods
- - (instancetype) runBlock:(dispatch_block_t)block ifStateDidChangeTo:(id)newState
If the new
stateis different from the previous one, runs theblocksynchronously.Parameters:
block
ifStateDidChangeTo: newState
Returns: a new instance that you should save to track the new state.