> For the complete documentation index, see [llms.txt](https://soufatn.gitbook.io/rxjs-book/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://soufatn.gitbook.io/rxjs-book/summary/observable/observable_instance_methods/window.md).

# window

Projects each element of an observable sequence into zero or more windows.

```javascript
// With window closing selector
Rx.Observable.prototype.window(windowClosingSelector);

// With window opening and window closing selector
Rx.Observable.prototype.window(windowOpenings, windowClosingSelector);

// With boundaries
Rx.Observable.prototype.window(windowBoundaries);
```

## Arguments

1. `[windowOpenings]` *(`Observable`)*: Observable sequence whose elements denote the creation of new windows&#x20;

   2.`[windowBoundaries]` *(`Observable`)*: Sequence of window boundary markers. The current window is closed and a new window is opened upon receiving a boundary marker.&#x20;
2. `windowClosingSelector` *(`Function`)*: A function invoked to define the closing of each produced window.

## Returns

*(`Observable`)*: An observable sequence of windows.

## Example

### With window boundaries

### With window opening and window closing selector

### With openings and closings
