Hyperlinkv0.8.0-beta.28

Hyperlink

Hyperlink.selfNodeconstsrc/Hyperlink.ts:5336
<Self, S extends Spec>(tag: HyperlinkTag<Self, S>): Effect.Effect<
  string,
  never,
  SelfNodeId<Self>
>

The node key this instance runs as — the same key its peers are keyed by. For folds that key per node (combineByNode), so a resource's own logic can name its own row without hand-threading the node key. Requires the selfNodeLayer / peersLayer capability:

fleetStatus: Effect.gen(function* () {
  const self = yield* Hyperlink.selfNode(FleetDatabase); // the node key I am
  const peers = yield* Hyperlink.peers(FleetDatabase);
  const byNode = yield* combineQuery(peers, (p) => p.status, combineByNode);
  return { ...byNode, [self]: yield* ownStatus }; // key my own row, consistently
})
Source src/Hyperlink.ts:53363 lines
export const selfNode = <Self, S extends Spec>(
  tag: HyperlinkTag<Self, S>,
): Effect.Effect<string, never, SelfNodeId<Self>> => tag[selfNodeSym];
Referenced by 1 symbols