# continueWith

Continues an Fx with a lazily created Fx after the first run returns.

## Signatures

```ts
export declare const continueWith: {
    <B, E2, R2>(f: () => Fx<B, E2, R2>): <A, E, R>(fx: Fx<A, E, R>) => Fx<A | B, E | E2, R | R2>;
    <A, E, R, B, E2, R2>(fx: Fx<A, E, R>, f: () => Fx<B, E2, R2>): Fx<A | B, E | E2, R | R2>;
};
```

## Why

This sequences two producer runs without converting either to a pull
collection. The thunk is lazy, so the continuation is not constructed until
the first `Fx.run` Effect returns.

## Ordering and cardinality

All successes from `fx` are delivered before successes from `f()`. A source
failure is also delivered to the shared Sink, but delivery does not fail
`Fx.run`: `Sink.onFailure` returns an Effect whose error channel is `never`.
After that handler returns, the continuation still runs. The two producers
never run concurrently.

## Ownership and lifetime

Failures and service requirements from both producers remain on the public
type and both failures are delivered to the same Sink. The returned Fx owns
neither input. Interruption or a defect that prevents the first run Effect
from returning also prevents the continuation from starting.

## Examples

```ts
import { Fx, Sink } from "@typed/fx"
import { Effect } from "effect"

const events: Array<string> = []
const phases = Fx.continueWith(Fx.fail("offline"), () => Fx.succeed("fallback"))
const program = phases.run(Sink.make(
  () => Effect.sync(() => events.push("failure delivered")),
  (value) => Effect.sync(() => events.push(value))
))

Effect.runPromise(program).then(() => console.log(events))
// ["failure delivered", "fallback"]
```
