when<T> method
T
when<T>({})
Implementation
T when<T>(
{required T Function(Added) added,
required T Function(Updated) updated,
required T Function(Removed) removed}) {
if (this is Added) return added(this as Added);
if (this is Updated) return updated(this as Updated);
if (this is Removed) return removed(this as Removed);
throw Exception('Invalid Change');
}