Skip to content

Electron Integration #1298

Answered by aklinker1
MentalGear asked this question in Q&A
Dec 21, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

You'll need a monorepo and you'll need to create abstractions that your UI and background logic can depend on. For example, to store settings, you'll probably want to create a storage interface and pass in two different implementations when creating your UI/background logic from each app:

// packages/shared/app-storage.ts
export interface AppStorage {
  getValue<T>(key: string): Promise<T>;
  setValue<T>(key: string, newValue: T): Promise<void>;
}
// apps/extension/extension-app-storage.ts
export function createExtensionAppStorage(): AppStorage {
  // Implement storage using browser.storage or @wxt-dev/storage or any other extension storage library
}
// apps/desktop/desktop-app-storage.ts
e…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@MentalGear
Comment options

@aklinker1
Comment options

@MentalGear
Comment options

Answer selected by MentalGear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants