I have an SPA that is loading some global/shared data (let's call this APP\_LOAD\_OK) and page-specific data (DASHBOARD\_LOAD\_OK) from the server. I want to show a loading animation until both APP\_LOAD\_OK and DASHBOARD\_LOAD\_OK are dispatched.

Now I have a problem with expressing this in RxJS. What I need is to trigger an action after each DASHBOARD\_LOAD\_OK, as long as there had been **at least** one APP\_LOAD\_OK. Something like this:

```
action$
  .ofType(DASHBOARD_LOAD_OK)
  .waitUntil(action$.ofType(APP_LOAD_OK).first())
  .mapTo(...)

```

Does anybody know, how I can express it in valid RxJS?