mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-23 13:02:58 +00:00
Complete Commonlib rc.6 integration and setup workflows
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { ServiceContextContract } from "@vrtmrz/livesync-commonlib/context";
|
||||
import type { CommonlibMessageKey, ServiceContextContract } from "@vrtmrz/livesync-commonlib/context";
|
||||
import type { ServiceHub } from "@vrtmrz/livesync-commonlib/compat/services/ServiceHub";
|
||||
|
||||
export const SERVICE_CONTEXT_MEMBERS = [
|
||||
@@ -43,7 +43,10 @@ export type ServiceCompositionResult = {
|
||||
* The caller chooses the translation key because translated text is
|
||||
* host-configured. Event delivery itself is shared behaviour.
|
||||
*/
|
||||
export function observeServiceContext(context: ServiceContextContract, translationKey: string): ServiceContextResult {
|
||||
export function observeServiceContext(
|
||||
context: ServiceContextContract,
|
||||
translationKey: CommonlibMessageKey
|
||||
): ServiceContextResult {
|
||||
const receivedEvents: string[] = [];
|
||||
const unsubscribe = context.events.onEvent("hello", (value) => receivedEvents.push(value));
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user