# fromOption

Creates a `RefSubject` from an `Option` value.

## Signatures

```ts
export declare function fromOption<A>(option: Option.Option<A>, options?: RefSubjectOptions<Option.Option<A>>): Effect.Effect<RefSubject<Option.Option<A>>, never, Scope.Scope>;
```

## Why

Stores the Option itself in writable state. `None` is an ordinary current value and does not add
`NoSuchElementError`; callers opt into absence semantics with `compact`, or a fallback with
`getOrElse`.

## Ownership and lifetime

Construction requires Scope because it delegates to `make`, but the supplied Option needs no
services and cannot fail. The returned RefSubject owns and publishes subsequent Option writes.

## Examples

```ts
import { Effect, Option } from "effect"
import * as RefSubject from "@typed/fx/RefSubject"

const program = Effect.gen(function* () {
  const ref = yield* RefSubject.fromOption(Option.some(42))
  const value = yield* ref
  console.log(Option.isSome(value)) // true
})
```
