# createNizhalMutators

```ts
import { createNizhalMutators } from "@nizhal/db-collection";

const { mutate } = createNizhalMutators({
  collections: { notes: notesCollection },
  echo,
  mutators: kernelMutators,
  onlineDetector, // optional — reactNativeOnlineDetector on RN
});
```

Wraps kernel `defineMutators` with TanStack `offline-transactions`:

- Optimistic local apply via TanStack DB
- `mutationFn` POSTs batches to `/sync/push` with idempotency key
- Bounded retries; deterministic failures → **poison quarantine** (REQ-13)
- Dependent mutations **cascade-cancel** so the queue keeps draining

## Poison handling

Surface quarantined entries via `createNizhalStatus` — show the user a fix/retry path instead of a silent stuck sync.

## Online detection

Web: browser online events. RN: `reactNativeOnlineDetector()` from `@nizhal/react-native` (NetInfo peer).