# `DDD.Slice`
[🔗](https://github.com/blackuprise/vicander/blob/v0.1.1/lib/ddd/use_cases/slice.ex#L1)

A window of a listing that continues from a cursor (keyset pagination). Returned by `slice/1`
on repository adapters and projections:

    {:ok, slice} = ListSummary.slice(order: [asc: :title], limit: 20)
    {:ok, next} = ListSummary.slice(order: [asc: :title], limit: 20, after: slice.next_cursor)

There is no `OFFSET`, so page 500 costs the same as page 1, and rows added or removed while
someone pages through don't shift what they see. `next_cursor` is `nil` on the last slice. A
cursor is opaque: it is only valid with the `:order` it came from, and the order's fields
should not be `NULL` (the primary key is always added as the last tie-breaker).

# `t`

```elixir
@type t() :: %DDD.Slice{
  entries: [term()],
  limit: pos_integer(),
  next_cursor: String.t() | nil
}
```

# `has_next?`

```elixir
@spec has_next?(t()) :: boolean()
```

True when there is a slice after this one.

---

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