# ServiceOf

> **ServiceOf**\<`R`\> = `R`\[`"_actor"`\]

Defined in: [core/src/types/reactor.ts:285](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/types/reactor.ts#L285)

The service type of a reactor, read from the reactor's own type. Pass
`typeof reactor` for a `Reactor`, a `DisplayReactor` or a subclass of
either.

Code that has only the reactor in scope, such as a component that imports
it, then needs neither the service type exported next to it nor the
transform spelled out. [ReactorArgsOf](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorargsof/), [ReactorDataOf](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactordataof/) and
[ReactorErrorOf](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorerrorof/) build on it.

## Type Parameters

### R

`R` *extends* `object`

The reactor's type, as `typeof reactor`.

## Example

```typescript
const ledger = new DisplayReactor<Ledger>({ clientManager, name: "ledger", idlFactory })

// "icrc1_balance_of" | "icrc1_transfer" | ...
type LedgerMethod = FunctionName<ServiceOf<typeof ledger>>
```