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

    • Overview
  • Library

    • Getting started
    • Result
    • Task
    • Type
    • Dependency injection
    • Conventions
  • 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 Alias: Order()<A>

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

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

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.

Type Parameters

Type Parameter
A

Parameters

ParameterType
xA
yA

Returns

Ordering

Was this page helpful?

© Copyright 2026. All rights reserved.

Follow us on GitHubFollow us on XJoin our Discord server