> 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/notification/notification_instance_methods/accept.md).

# accept

Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.

## Arguments

1. `[observer]` *(Observer)*: Observer to invoke the notification on.
2. `[onNext]` *(Function)*: Function to invoke for an OnNext notification.
3. `[onError]` *(Function)*: Function to invoke for an OnError notification.
4. `[onError]` *(Function)*: Function to invoke for an OnCompleted notification.

### Returns

*(Any)*: Result produced by the observation.

### Example

#### [Using an observer](http://jsbin.com/bazah/2/edit?js,console)

```javascript
var observer = Rx.Observer.create(x => x);

var notification = Rx.Notification.createOnNext(42);

console.log(notification.accept(observer));

// => 42
```

#### [Using a function](http://jsbin.com/tuqiye/3/edit?js,console)

```javascript
var notification = Rx.Notification.createOnNext(42);

console.log(notification.accept(x => x));
// => 42
```

#### Using an observer

#### Using a function
