Giter VIP home page Giter VIP logo

hooks-for-redux's People

Contributors

dependabot[bot] avatar mattcgenui avatar shanebdavis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hooks-for-redux's Issues

TS Definitions file

I find articles as a way to promote open source work a pretty effective way of doing it, good job!

Any plans adding TS types for the folks? ๐Ÿ˜„

Immer support

I'm trying to refactor from redux toolkit, but prefer the immer syntax. Trying to figure out a way to use this same pattern with immer syntax reducers.

I've tried swapping the combineReducers function in hooks-for-redux with redux-immer https://www.npmjs.com/package/redux-immer and adding immer, but that wasn't working. Kept getting an error that it couldn't find immer's produce method.

extend the H4R's createStore to accept a reducer function as the first argument

The goal here is to allow people to incrementally convert an existing Redux project to H4R. To start, someone would just replace the Redux createStore with the H4R createStore. In order to do this, H4R's createStore needs to support the same API as Redux (it doesn't currently).

After solely replacing Redux's createStore with H4Rs, the rest of the project should still run and work unchanged. From there, the people doing the migration could incrementally either add createReduxModule calls for new slices or start replacing existing Redux state with createReduxModule.

Support this pattern:

import { setStore, createStore } from "hooks-for-redux";

export default setStore(createStore((state) => state));

Access actions called on store

Hi, apologies if this is the wrong place for this, but I am wondering if there is a way to access the actions that have been called on a store with this library? Traditional redux has a getActions method available on the store, but I'm not seeing that with this library.

We are trying to test that (non-visible) actions have been called on the store as a side effect in one of our components using Jest.

Typescript support for custom selectors

Now that we have #9 custom selectors, we also need to add typescript support for them. The ReactReduxHook type in the index.d.ts file needs to be updated to take the optional, custom selector as input and, if provided, return the same time the custom-reducer returns.

support for custom selectors

I'd like to add the ability to optionally select a subset of the H4R redux slice and only re-render when that subset changes:

const [use, {...}] = createReduxModule('example', {foo: 1, bar: 2}, {...})

const MyComponent = () => {
  const foo = use(({foo}) => foo) // doesn't re-render if bar changes
  return ...
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.