F+Foldkit Plus
HomeLearnPackagesComponentsPrimitivesDemosBlogGitHub ↗

Sync

Guides

foldkit-sync

  • Overview
  • Run it in the browser
  • The server
  • Serving from a Durable Object
  • What makes a Message durable
  • What to show the user
  • Growing the application
  • Testing without a browser or a server
  • When things go wrong
  • Advanced: the replica
  • Ownership and responsibilities

foldkit-durable

  • Overview
  • Pairing with foldkit-sync
  • Running in a browser or custom SQLite runtime
  • What append guarantees
  • Validation and authorization
  • Reading history
  • External effects and the crash gap
  • Retention
  • Services, codecs, errors, metrics
  • On Cloudflare D1 (d1: true)
  • Limits

Replicated state

  • Overview
  • Choose the right owner for each piece of state
  • How visible state rebases over committed state
  • 1. Declare what is shared
  • 2. Mount the replica in the browser
  • 3. The server: an exchange over the journal
  • Choosing document boundaries
  • 4. What the user sees, and what waits for the server
  • Lifecycle of a single edit
  • Changing a durable Message
  • When things go wrong

Editing server data

  • Overview
  • When to use this pattern, and who owns what
  • How an edit moves from the screen to the table
  • A first editable column: cents
  • What each helper handles
  • Handling conflicts, compaction, and cell marks
  • Failure modes and recovery

API

foldkit-sync

  • foldkit-sync
  • foldkit-sync/journal
  • foldkit-sync/entity
  • foldkit-sync/do
  • foldkit-sync/remote

foldkit-durable

  • foldkit-durable
  • foldkit-durable/core

Open source, MIT
Foldkit 0.170 · Effect 4

Sync / foldkit-sync/do

AlarmStorage

interface · packages/sync/src/do.ts:50

interface AlarmStorage {
  getAlarm(): Promise<number | null>
  setAlarm(scheduledTime: number): Promise<void>
}

The alarm a Durable Object's storage keeps: one per object.

Members

AlarmStorage.getAlarm#

method · packages/sync/src/do.ts:51

getAlarm(): Promise<number | null>

AlarmStorage.setAlarm#

method · packages/sync/src/do.ts:52

setAlarm(scheduledTime: number): Promise<void>
Previousfoldkit-sync/do

On this page

  • getAlarm
  • setAlarm

Edit on GitHub ↗

This site is a Foldkit Plus application, rendered at build time with foldkit-ssr. Its source

FoldkitEffectGitHub

Menu

HomeLearnPackagesComponentsPrimitivesDemosBlogGitHub ↗

Sync

Guides

foldkit-sync
  • Overview
  • Run it in the browser
  • The server
  • Serving from a Durable Object
  • What makes a Message durable
  • What to show the user
  • Growing the application
  • Testing without a browser or a server
  • When things go wrong
  • Advanced: the replica
  • Ownership and responsibilities
foldkit-durable
  • Overview
  • Pairing with foldkit-sync
  • Running in a browser or custom SQLite runtime
  • What append guarantees
  • Validation and authorization
  • Reading history
  • External effects and the crash gap
  • Retention
  • Services, codecs, errors, metrics
  • On Cloudflare D1 (d1: true)
  • Limits
Replicated state
  • Overview
  • Choose the right owner for each piece of state
  • How visible state rebases over committed state
  • 1. Declare what is shared
  • 2. Mount the replica in the browser
  • 3. The server: an exchange over the journal
  • Choosing document boundaries
  • 4. What the user sees, and what waits for the server
  • Lifecycle of a single edit
  • Changing a durable Message
  • When things go wrong
Editing server data
  • Overview
  • When to use this pattern, and who owns what
  • How an edit moves from the screen to the table
  • A first editable column: cents
  • What each helper handles
  • Handling conflicts, compaction, and cell marks
  • Failure modes and recovery

API

foldkit-sync
  • foldkit-sync
  • foldkit-sync/journal
  • foldkit-sync/entity
  • foldkit-sync/do
  • foldkit-sync/remote
foldkit-durable
  • foldkit-durable
  • foldkit-durable/core

Open source, MIT
Foldkit 0.170 · Effect 4