# RefSubject.fromStream

Creates a RefSubject that tracks the latest value emitted by an Effect Stream.

## Signatures

```ts
export declare function fromStream<A, E, R>(stream: Stream.Stream<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;
```

## Why

Bridges a pull-based Stream into renderer-independent state: each emitted value enters the
RefSubject's serialized commit path, while a stream failure becomes the ref's current and pushed
failure.

## Ownership and lifetime

Construction forks stream consumption immediately into the RefSubject's private Scope and cannot
fail. `R` is required while constructing that fiber; closing the outer Scope interrupts it.
Before the first value or failure, a current read waits for initialization. Later reads and pushes
expose `E`.
