Skip to content

Commit

Permalink
Update getting-started.md
Browse files Browse the repository at this point in the history
  • Loading branch information
goosewobbler authored Dec 6, 2024
1 parent f2e89a3 commit 05826ac
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ store = createStore<AppState>()(() => initialState);

#### Initialize Bridge in Main process

In the main process, the bridge needs your store and an array of BrowserWindow, BrowserView, and WebContentsView objects for your app, so for a single window application:
In the main process, the bridge needs your store and an array of window or view objects for your app. `BrowserWindow`, `BrowserView` and `WebContentsView` objects are supported.

So, for a single window application:

```ts
import { mainZustandBridge } from 'zutron/main';

// create mainWindow
const mainWindow = new BrowserWindow(windowConfig);

const { unsubscribe } = mainZustandBridge(store, [mainWindow]);

Expand All @@ -51,7 +54,7 @@ contextBridge.exposeInMainWorld('zutron', handlers);

#### Create hook in Renderer process

Finally, in the renderer process you will need to create the useStore hook:
Finally, in the renderer process you will need to create the `useStore` hook:

`/renderer/hooks/useStore.ts`

Expand Down

0 comments on commit 05826ac

Please sign in to comment.