Add "buffer(=> Observable[Any])" to replace "buffer(() => Observable[Any])" and "buffer(Observable[Any])""; Remove the cast for "window(=> Observable[Any])"