RxJS/Angular experts, need your input/pointers 

I am trying to put a logic on the Observable (created from http call) 

I want to return (come out of the waiting and discontinue subscription on the observable) if first event is not emitted from Observable in first 3 mins 

But if first event is emitted in first 3 mins, I want to continue with subscription & get the data for total of 10 mins (from the time subscription started)

As of now, using takeUntil(timer(1000 \* 60 \* 10) to wait for total 10 mins, but want to divide this wait in 3 mins, and if some response -> then only extend by 7mins

**pseudo code**

```js
Observable
.pipe(
    takeUntil(timer(10* 60 * 1000)),
    map (res => {}),
    filter()
)
.subscribe(

)

```

Note: the above call wraps on the EventSource SSE call

I thought to use out of box RxJS timeout, but does not fit to my requirement