Skip to content

Commit

Permalink
Return snapshot of received notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragemil committed Oct 19, 2023
1 parent b3b9640 commit e6a4ce6
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,12 @@ bool NotificationAndTypePredicate(object n) =>
n is TNotification tn && notificationPredicate(tn);
}

/// <returns>A FIFO collection of received notifications on topic instance.</returns>
public static IReadOnlyCollection<object> NotificationsOn<TTopic>(
this LeanPipeTestClient client,
TTopic topic
)
/// <returns>A FIFO collection snapshot of received notifications on topic instance.</returns>
public static List<object> NotificationsOn<TTopic>(this LeanPipeTestClient client, TTopic topic)
where TTopic : ITopic
{
return client.Subscriptions.GetValueOrDefault(topic)?.ReceivedNotifications
?? new List<object>();
return client.Subscriptions.GetValueOrDefault(topic)?.ReceivedNotifications.ToList()
?? new();
}

/// <summary>
Expand Down

0 comments on commit e6a4ce6

Please sign in to comment.