Skip to main content
Module

x/earthstar/src/entries/universal.ts>SharedSettings#getPeer

Storage for private, distributed, offline-first applications.
Go to Latest
method SharedSettings.prototype.getPeer
import { SharedSettings } from "https://deno.land/x/earthstar@v10.0.2/src/entries/universal.ts";

Get a new Peer preconfigured with shares, secrets, and syncers derived from these settings.

When settings are updated, the peer's replicas and syncers will be updated too.

Parameters

unnamed 0: { sync: "once" | "continuous" | false; onCreateReplica: (addr: ShareAddress, secret?: string) => Replica; }

Returns

{ peer: Peer; unsubscribeFromSettings: () => void; }