[API Reference](../README.md) > [EntityFetcher](../interfaces/EntityFetcher.md)

# Interface: EntityFetcher

Returned by EntityFetcherFactory<TDest, TSrc>.

## Type parameters
#### TDest 
#### TSrc 
## Hierarchy

**EntityFetcher**

## Index

### Properties

* [get](EntityFetcher.md#get)
* [subscribe](EntityFetcher.md#subscribe)
* [watch](EntityFetcher.md#watch)

### Methods

* [stopWatching](EntityFetcher.md#stopWatching)
* [stopWatchingAsync](EntityFetcher.md#stopWatchingAsync)

---

## Properties

<a id="get"></a>

###  get

**● get**: *`function`*

*Defined in [web3EventService.ts:434](https://github.com/daostack/arc.js/blob/6f704389/lib/web3EventService.ts#L434)*

Get an array of `TDest` from Web3, given the filter supplied to the EntityFetcherFactory. You may supply a callback, which will be given the array, or you may accept the promise of the array from the return value of `get`. If `requiredDepth` is set then will not invoke the callback until the transaction has been mined to the requiredDepth.

#### Type declaration
▸(callback?: *[EntityGetCallback](../#EntityGetCallback)<`TDest`>*, requiredDepth?: *`number`*): `Promise`<`Array`<`TDest`>>

**Parameters:**

| Param | Type |
| ------ | ------ |
| `Optional` callback | [EntityGetCallback](../#EntityGetCallback)<`TDest`> |
| `Optional` requiredDepth | `number` |

**Returns:** `Promise`<`Array`<`TDest`>>

___
<a id="subscribe"></a>

###  subscribe

**● subscribe**: *`function`*

*Defined in [web3EventService.ts:453](https://github.com/daostack/arc.js/blob/6f704389/lib/web3EventService.ts#L453)*

Watch for `TDest`s from Web3, given the filter supplied to the EntityFetcherFactory. The Pub.Sub is published once per event firing. `subscribe` returns the subscription on which you must remember to call `unsubscribe` when you are done watching. If `requiredDepth` is set then will not invoke the callback until the transaction has been mined to the requiredDepth.

Supply whatever name you want for `eventName`. This enables you to scope event handlers across event types and schemes.

#### Type declaration
▸(eventName: *`string`*, callback?: *[EntityWatchSubscriptionCallback](../#EntityWatchSubscriptionCallback)<`TDest`>*, requiredDepth?: *`number`*): [IEventSubscription](IEventSubscription.md)

**Parameters:**

| Param | Type |
| ------ | ------ |
| eventName | `string` |
| `Optional` callback | [EntityWatchSubscriptionCallback](../#EntityWatchSubscriptionCallback)<`TDest`> |
| `Optional` requiredDepth | `number` |

**Returns:** [IEventSubscription](IEventSubscription.md)

___
<a id="watch"></a>

###  watch

**● watch**: *`function`*

*Defined in [web3EventService.ts:441](https://github.com/daostack/arc.js/blob/6f704389/lib/web3EventService.ts#L441)*

Watch for `TDest`s from Web3, given the filter supplied to the EntityFetcherFactory. The callback is invoked once per event firing. If `requiredDepth` is set then will not invoke the callback until the transaction has been mined to the requiredDepth.

#### Type declaration
▸(callback: *[EntityWatchCallback](../#EntityWatchCallback)<`TDest`>*, requiredDepth?: *`number`*): `void`

**Parameters:**

| Param | Type |
| ------ | ------ |
| callback | [EntityWatchCallback](../#EntityWatchCallback)<`TDest`> |
| `Optional` requiredDepth | `number` |

**Returns:** `void`

___

## Methods

<a id="stopWatching"></a>

###  stopWatching

▸ **stopWatching**(callback?: *[fnVoid](../#fnVoid)*): `void`

*Defined in [web3EventService.ts:460](https://github.com/daostack/arc.js/blob/6f704389/lib/web3EventService.ts#L460)*

Stop watching the event.

**Parameters:**

| Param | Type |
| ------ | ------ |
| `Optional` callback | [fnVoid](../#fnVoid) |

**Returns:** `void`

___
<a id="stopWatchingAsync"></a>

###  stopWatchingAsync

▸ **stopWatchingAsync**(): `Promise`<`void`>

*Defined in [web3EventService.ts:465](https://github.com/daostack/arc.js/blob/6f704389/lib/web3EventService.ts#L465)*

Asynchronously stop watching the event, for environments where synchronous methods are not allowed.

**Returns:** `Promise`<`void`>

___

