Skip to content

export build hooks#3451

Open
lucashm wants to merge 4 commits into
reduxjs:masterfrom
lucashm:feature/export-build-hooks
Open

export build hooks#3451
lucashm wants to merge 4 commits into
reduxjs:masterfrom
lucashm:feature/export-build-hooks

Conversation

@lucashm

@lucashm lucashm commented May 16, 2023

Copy link
Copy Markdown

No description provided.

@codesandbox

codesandbox Bot commented May 16, 2023

Copy link
Copy Markdown

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders | Preview

@netlify

netlify Bot commented May 16, 2023

Copy link
Copy Markdown

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit d7bcac3
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/6464cd3f83db25000805bd2d
😎 Deploy Preview https://deploy-preview-3451--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codesandbox-ci

codesandbox-ci Bot commented May 16, 2023

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d7bcac3:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
reduxjs/redux-toolkit Configuration
reduxjs/redux-toolkit Configuration
reduxjs/redux-toolkit Configuration

@lucashm

lucashm commented May 17, 2023

Copy link
Copy Markdown
Author

Usage example:

import React from 'react';
import store, { userSlice, buildHooksFromSlice } from 'remote_entry/globalStore';
import { Provider, createDispatchHook, createSelectorHook, createStoreHook, batch } from 'react-redux';

const GlobalStateContext = React.createContext(null);
const useStore = createStoreHook(GlobalStateContext);
const useDispatch = createDispatchHook(GlobalStateContext);
const useSelector = createSelectorHook(GlobalStateContext);

const userHooks = userSlice.buildHooksFromReactInstance({
  React,
  batch,
  useDispatch,
  useSelector,
  useStore,
  unstable__sideEffectsInRender: false,
 })

@markerikson markerikson added this to the Post 2.0 milestone Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants