Skip to content

Commit

Permalink
fix(fromEvent): set immediate for from (issue vitest-dev#1099) (vit…
Browse files Browse the repository at this point in the history
  • Loading branch information
akarelas committed Dec 31, 2021
1 parent f08045e commit 0af4450
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rxjs/from/index.ts
Expand Up @@ -20,7 +20,7 @@ export function from<T>(value: ObservableInput<T> | Ref<T>, watchOptions?: Watch
}

export function fromEvent<T extends HTMLElement>(value: Ref<T>, event: string): Observable<Event> {
return from(value).pipe(
return from(value, {immediate: true}).pipe(
filter(value => value instanceof HTMLElement),
mergeMap(value => fromEventRx(value, event)),
)
Expand Down

0 comments on commit 0af4450

Please sign in to comment.