Skip to content

TypeScript API / @contentia/vite-plugin / createRepositoryChangeChannel

Function: createRepositoryChangeChannel() ​

ts
function createRepositoryChangeChannel(
   repos, 
   server, 
   options?
): Unsubscribe;

Wire a ContentiaRepositories to a Vite dev server so on-disk content changes trigger HMR. Subscribes to the storage repository's push channel (and any future documents push channel) when it advertises one; repositories without subscription support are silently skipped.

Parameters ​

ParameterType
reposContentiaRepositories
serverHmrServer
options?RepositoryChangeChannelOptions

Returns ​

Unsubscribe

a dispose function that removes every subscription. Idempotent.