### Setup reduxtron vanilla boilerplate project Source: https://github.com/vitordino/reduxtron/blob/main/packages/boilerplate-vanilla/README.md Provides step-by-step instructions to clone, navigate into, install dependencies, and run a new reduxtron project using `npx degit` and `npm` commands. ```bash # clone this folder: npx degit vitordino/reduxtron/packages/boilerplate-vanilla new-reduxtron-project # cd to it cd new-reduxtron-project # install dependencies npm i # run dev script npm run dev ``` -------------------------------- ### Reduxtron Vue Project Setup Source: https://github.com/vitordino/reduxtron/blob/main/packages/boilerplate-vue/README.md This snippet provides the necessary bash commands to set up a new Reduxtron Vue project. It covers cloning the boilerplate, navigating into the project directory, installing dependencies, and starting the development server. ```bash # clone this folder: npx degit vitordino/reduxtron/packages/boilerplate-vue new-reduxtron-project # cd to it cd new-reduxtron-project # install dependencies npm i # run dev script npm run dev ``` -------------------------------- ### Setting Up a New Reduxtron Svelte Project Source: https://github.com/vitordino/reduxtron/blob/main/packages/boilerplate-svelte/README.md This snippet provides the necessary bash commands to clone the boilerplate repository, navigate into the newly created project directory, install all required dependencies, and finally start the development server for a Reduxtron Svelte application. ```bash # clone this folder: npx degit vitordino/reduxtron/packages/boilerplate-svelte new-reduxtron-project # cd to it cd new-reduxtron-project # install dependencies npm i # run dev script npm run dev ``` -------------------------------- ### Clone and Run Reduxtron Demo Application Source: https://github.com/vitordino/reduxtron/blob/main/README.md Provides commands to clone the Reduxtron repository, install dependencies, and start the demo application in development mode. ```bash git clone git@github.com/vitordino/reduxtron.git cd reduxtron npm i turbo demo ``` -------------------------------- ### Setup a New Reduxtron React Project Source: https://github.com/vitordino/reduxtron/blob/main/packages/boilerplate-react/README.md This snippet outlines the essential steps to initialize, navigate into, install dependencies for, and run a new Reduxtron React project using the provided boilerplate. ```bash # clone this folder: npx degit vitordino/reduxtron/packages/boilerplate-react new-reduxtron-project # cd to it cd new-reduxtron-project # install dependencies npm i # run dev script npm run dev ``` -------------------------------- ### Install Reduxtron Dependency Source: https://github.com/vitordino/reduxtron/blob/main/README.md Installs Reduxtron as a regular npm dependency for your project. ```npm npm i reduxtron ``` -------------------------------- ### Initialize Svelte Application Source: https://github.com/vitordino/reduxtron/blob/main/packages/demo/src/renderer/add-to-do/svelte.html This snippet illustrates the standard way to bootstrap a Svelte application. It imports the root `App` component, typically defined in `svelte.svelte` or a similar file, and then creates a new instance of it, specifying `document.body` as the target element where the application will be rendered. ```Svelte import App from './svelte.svelte' new App({ target: document.body }) ``` -------------------------------- ### Initialize and Mount Vue 3 Application Source: https://github.com/vitordino/reduxtron/blob/main/packages/demo/src/renderer/add-to-do/vue.html This code snippet illustrates the fundamental steps to initialize a Vue 3 application. It imports necessary functions like `createApp` and `h`, defines a root component (`MainComponent`), and then mounts the application to the `body` element of the HTML document. ```Vue import { createApp, h } from 'vue' import MainComponent from './vue.vue' const app = createApp({ render: () => h(MainComponent) }) app.mount('body') ``` -------------------------------- ### Initialize Redux Bridge in Electron Main Process Source: https://github.com/vitordino/reduxtron/blob/main/README.md Sets up the Redux bridge in the Electron main process, connecting `ipcMain` with the Redux store. It also ensures proper unsubscription on application quit. ```typescript import { app, ipcMain } from "electron"; import { mainReduxBridge } from "reduxtron/main"; import { store } from "shared/store"; const { unsubscribe } = mainReduxBridge(ipcMain, store); app.on("quit", unsubscribe); ``` -------------------------------- ### Reduxtron Global API Reference Source: https://github.com/vitordino/reduxtron/blob/main/README.md Describes the Redux store functions exposed globally to the frontend runtime by Reduxtron, including `getState`, `dispatch`, and `subscribe`. ```APIDOC // typical redux getState function, have the State return type defined as return global.reduxtron.getState(): State // typical redux dispatch function, have the Action type defined as parameter global.reduxtron.dispatch(action: Action): void // receives a callback that get’s called on each store update // returns a `unsubscribe` function, you can optionally call it when closing window or when you don’t want to listen for changes anymore. global.reduxtron.subscribe(callback: ((newState: State) => void) => () => void) ``` -------------------------------- ### Initialize Redux Bridge in Electron Preload Script Source: https://github.com/vitordino/reduxtron/blob/main/README.md Configures the Redux bridge in the Electron preload script, exposing Redux store handlers to the renderer process via `contextBridge`. This allows the renderer to interact with the shared Redux store. ```typescript import { contextBridge, ipcRenderer } from "electron"; import { preloadReduxBridge } from "reduxtron/preload"; import type { State, Action } from "shared/reducers"; const { handlers } = preloadReduxBridge(ipcRenderer); contextBridge.exposeInMainWorld("reduxtron", handlers); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.