mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-06 23:44:36 +00:00
src/next is src (the main export), src/next-node is src/node with short subpaths (/http, /workers, /plugins, /plugins/runtime, /app, /surfaces, /web, /react, /tui, /tui/launcher); the foundations get /json and /watch; Chord v1 moves to src/old (/old, /old/node) until p2 runs on v2; tests and docs move likewise (test/, docs/, test/old, docs/old). Durable and env import the foundations from their subpaths.
9 lines
468 B
TypeScript
9 lines
468 B
TypeScript
// The clock plugin's server facet: serves `Clock` with the time its script was evaluated. The example never edits
|
|
// this plugin, so a reload leaves it as it is: same script, same facet, same object.
|
|
|
|
import { constant, defineFacet } from "@earendil-works/chord";
|
|
import { Clock } from "../contracts/contract.ts";
|
|
|
|
const evaluatedAt = new Date().toISOString();
|
|
|
|
export default defineFacet((host) => host.serve(Clock, () => ({ evaluatedAt: constant(evaluatedAt) })));
|