# useRefSubject

Observes any RefSubject, including hydrated refs with typed failures. Writes
use its serialized transactions; failures also reach `state` when a native
binding ignores the returned Exit. Unmount/runtime replacement cancels writes.
The first subscription receives the optional initial value or `undefined`.
Lazy initializers only start after mount; `initial` can seed matching SSR and
hydration values without executing application effects during rendering.

## Signatures

```ts
export declare function useRefSubject<A, E = never, R = never, ER = never>(ref: RefSubject.RefSubject<A, E, R>, options: RefSubjectOptions<A, E, R, ER> & {
    readonly initial: A;
}): RefSubjectStore<A, E | ER, never>;
```

```ts
export declare function useRefSubject<A, E = never, R = never, ER = never>(ref: RefSubject.RefSubject<A, E, R>, options?: RefSubjectOptions<A, E, R, ER>): RefSubjectStore<A, E | ER>;
```


