Skip to content

TypeScript API / @laikacms/vite-plugin / createRepositoryChangeChannel

Function: createRepositoryChangeChannel() ​

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

Wire a LaikaRepositories 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
reposLaikaRepositories
serverHmrServer
optionsRepositoryChangeChannelOptions

Returns ​

Unsubscribe

a dispose function that removes every subscription. Idempotent.

Released under the MIT License.