Notification events resolving and rendering in batches (#4722)
- Use `NotiticationService.getNotifications()` function so we resolve the events in bulk. - Added `NotifierResolverQueue` to group the notifications to resolve based on a debounce strategy. - Batch rendering of these events as notifications.
This commit is contained in:
parent
f0c9f8294a
commit
f455085e08
30 changed files with 882 additions and 523 deletions
|
|
@ -24,6 +24,18 @@ fun <T> value(expectedValue: T) = object : ParameterMatcher {
|
|||
override fun toString(): String = "value($expectedValue)"
|
||||
}
|
||||
|
||||
/**
|
||||
* A matcher that matches a value based on a condition.
|
||||
* Can be used to assert that a lambda has been called with a value that satisfies a specific condition.
|
||||
*/
|
||||
fun <T> matching(check: (T) -> Boolean) = object : ParameterMatcher {
|
||||
override fun match(param: Any?): Boolean {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return (param as? T)?.let { check(it) } ?: false
|
||||
}
|
||||
override fun toString(): String = "matching(condition)"
|
||||
}
|
||||
|
||||
/**
|
||||
* A matcher that matches any value.
|
||||
* Can be used when we don't care about the value of a parameter.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue