Explorer

definy.read-snapshots

description
(en) The accepted project snapshots in the order of the store (newest first). Only the latest snapshot of each branch is full (with every part); the others are light summaries without parts (definy.snapshot-cache-entry-summary), so that a page does not read every part of every snapshot. Use definy.read-snapshots-with for other full snapshots
type
Fn(then: Fn(commits: List<@definy.event-snapshot>) -> @definy.service-io) -> @definy.service-io
expression
fn(then$0) =>
  @definy.read-snapshot-summary-list(
    then: fn(commits$1) =>
      @definy.read-full-snapshots(
        event_hashes: @core.list-map(
          T: @core.branch-summary,
          U: String,
          f: fn(item$2) =>
            $2.latest_event_hash,
          xs: @core.project-branches(
            commits: @core.list-map(
              T: @definy.event-snapshot,
              U: @core.snapshot-summary,
              f: fn(item$3) =>
                @definy.snapshot-summary-of(commit: $3),
              xs: $1
            )
          )
        ),
        then: fn(commits$4) =>
          $0(commits: @definy.event-snapshots-replace(commits: $1, full: $4))
      )
  )
visibility
public
definy.read-snapshots (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: hM3pjZUOS0BDg89fDKxuMkFFiEBftVh5N4Z4hcGCVDQ
content hash: 21OqwA4vIxaiaRZI8qair38nf0xW3X7tqdMV0xew_ss