# `GeoGenius.Providers.Batch`
[🔗](https://github.com/agoodway/geo_genius/blob/main/lib/geo_genius/providers/batch.ex#L1)

Turns a list of raw items into staged rows, one `fun` call per item,
stopping at the first error.

Shared by every provider's per-chunk staging step: `GeoGenius.Providers.GeoJSON`
builds one `GeoGenius.Staging.Row` per GeoJSON feature, `GeoGenius.Providers.CSV`
one per delimited data row, and both need the same collect-or-halt, then-reverse
machinery -- previously duplicated between them as `rows_for/2`,
`collect_row/3`, and `finish_rows/1`, divergent only in how many extra
arguments each provider's own `row_for` needed.

# `rows`

```elixir
@spec rows([term()], (term() -&gt; {:ok, GeoGenius.Staging.Row.t()} | {:error, term()})) ::
  {:ok, [GeoGenius.Staging.Row.t()]} | {:error, term()}
```

Applies `fun` to every item in `items`, returning the staged rows in the
original order.

Stops at the first `{:error, reason}` `fun` returns, propagating it rather
than staging the remaining items.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
