Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export build hooks #3451

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lucashm
Copy link

@lucashm lucashm commented May 16, 2023

No description provided.

@codesandbox
Copy link

codesandbox bot commented May 16, 2023

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

@netlify
Copy link

netlify bot commented May 16, 2023

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
Copy link

codesandbox-ci bot commented May 16, 2023

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
Copy link
Author

lucashm commented May 17, 2023

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