• Blog
  • Changelog
  • Follow us on GitHubFollow us on XJoin our Discord server
  • Blog
  • GitHub
  • Releases
  • Getting started

    • Overview
  • Library

    • Getting started
    • Array
    • Result
    • Dependency injection
    • Resource management
    • Task
    • Type
    • Conventions
    • Testing
  • Local-first

    • Getting started
    • Playgrounds
    • Examples
    • Owners
    • Relay
    • Migrations
    • Time travel
    • Indexes
    • Protocol
    • Privacy
    • FAQ
  • Other

    • API reference
    • Comparison
    • Showcase
    • Changelog

API reference › @evolu/common › Order › Order

type Order<A> = (x: A, y: A) => Ordering;

Defined in: packages/common/src/Order.ts:21

Compares two values of type A and returns their ordering.

Ordering functions start with an 'order' prefix, e.g., orderNumber.

  • Returns -1 if x is less than y.
  • Returns 0 if x is equal to y.
  • Returns 1 if x is greater than y.

An Order also defines equality. Use eqFromOrder to derive an Eq.

Markdown for LLMs

© 2026 Evolu

Follow us on GitHubFollow us on XJoin our Discord server