mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-17 22:14:26 +01:00
update
This commit is contained in:
@@ -8,6 +8,7 @@ export type UseSubscriptionProps = {
|
||||
options?: SubscriptionOptions;
|
||||
// subscribe not only stored events but also new events published after the subscription
|
||||
// default is true
|
||||
clientEventFilter?: (event: NostrEvent) => boolean;
|
||||
continuous?: boolean;
|
||||
onEvent?: (event: NostrEvent) => void;
|
||||
onEOSE?: () => void;
|
||||
@@ -36,6 +37,9 @@ const useSubscription = (propsProvider: () => UseSubscriptionProps | null) => {
|
||||
if (onEvent != null) {
|
||||
onEvent(event);
|
||||
}
|
||||
if (props.clientEventFilter != null && !props.clientEventFilter(event)) {
|
||||
return;
|
||||
}
|
||||
if (!eose) {
|
||||
pushed = true;
|
||||
storedEvents.push(event);
|
||||
|
||||
Reference in New Issue
Block a user