Small utility for react-redux's `useSelector` that allows passing args.

Overview

use-selector-with

Code Style: Prettier TypeScript: Strict NPM version Join the chat at https://gitter.im/Codecademy/use-selector-with

Monorepo for the following two packages:

Development

yarn
yarn lerna bootstrap
yarn compile -w

Contribution Guidelines

We'd love to have you contribute! Check the issue tracker for issues labeled accepting prs to find bug fixes and feature requests the community can work on. If this is your first time working with this code, the good first issue label indicates good introductory issues.

Please note that this project is released with a Contributor Covenant. By participating in this project you agree to abide by its terms. See CODE_OF_CONDUCT.md.

You might also like...

React styling. Plain and simple.

Table of Contents Install Getting Started Usage API Install npm install react-classy Getting Started Classy makes styling React components composable,

Jan 1, 2023

styled component for react & style-loader/usable

react-styled ES7 decorator for dynamic stylesheet usage w/ webpack install $ npm install bloody-react-styled --save-dev require import styled from "bl

Sep 26, 2022

Use CSS-in-JavaScript with themes for React without being tightly coupled to one implementation

Use CSS-in-JavaScript with themes for React without being tightly coupled to one implementation

react-with-styles Use CSS-in-JavaScript for your React components without being tightly coupled to one implementation (e.g. Aphrodite, Radium, or Reac

Dec 8, 2022

A built-time CSS library for styling React components.

A built-time  CSS library for styling React components.

Stylin Stylin is a build-time CSS library that offers an elegant way to style React components. It extends CSS Modules and adds some missing features

Dec 30, 2022

A React.js Nice Resume Template

A React.js Nice Resume Template

React Nice Resume DEMO is here About particles-bg library This project uses the react particle background component library https://github.com/lindelo

Dec 28, 2022

A react wonderful landingpage template

A react wonderful landingpage template

Wonderful Landing Page Template LIVE DEMO Description This is a ReactJS based landing page template, fit for a startup company/service with a one page

Jan 6, 2023

Startup Landing Page Components for React.js

neal-react neal-react is a collection of reactjs components to quickly build landing pages. I found that using hosted services like Launchrock doesn't

Nov 30, 2022

Minimal Portfolio Page Built with React

Minimal Portfolio Page Built with React

Minimal Portfolio Page Built with React Documentation : https://github.com/singhkshitij/My-Landing-Page/wiki/ Demo https://singhkshitij.github.io/My-L

Dec 19, 2022

rede social inspirada no youTube para aprendizado na area da programação utilizando o react js juntamente com typescript

media for devs a rede social de videos para programadores link do projeto api repositorio projeto feito com o objetivo de exercitar minhas skills tant

Nov 26, 2021
Comments
  • Benefit?

    Benefit?

    Curious, is there a benefit to useSelectorWith like the following:

    import { useSelectorWith } from 'use-selector-with';
    
    const selectFruit = (state, name) => state.fruits[name];
    
    const MyComponent = () => {
      const apple = useSelectorWith(selectFruit, 'apple');
    
      // ...
    };
    

    versus just using useSelector?

    import { shallowEqual, useSelector } from 'react-redux';
    
    const selectFruit = (state, name) => state.fruits[name];
    
    const MyComponent = () => {
      const apple = useSelector(state => selectFruit(state, 'apple'), shallowEquals);
    
      // ...
    };
    

    Performance wise I think the useSelector version would be actually a smidge faster and I don't see any other relevant differences but I could be missing something!

    Busy this week but sometime I'll try to do a microbenchmark. The useCallback inside useSelectorWith adds some overhead, probably more than memoizing the selector function would gain, except for maybe very very complex selectors. Fun reading, react perf is tricky: https://kentcdodds.com/blog/usememo-and-usecallback

    documentation 
    opened by danstiner 3
  • ✏️ Fix typo in eslint plugin README.md

    ✏️ Fix typo in eslint plugin README.md

    Neat selector! Saw a tiny typo in the README and fixed it :)

    Was hoping this would solve some selector issues I've been working through recently but this solves a slightly different issue.

    opened by danstiner 2
Owner
Codecademy
The easiest way to learn to code.
Codecademy
A utility-first CSS framework for rapid UI development.

A utility-first CSS framework for rapidly building custom user interfaces. Documentation For full documentation, visit tailwindcss.com. Community For

Tailwind Labs 63.5k Dec 30, 2022
Low-level CSS Toolkit – the original Functional/Utility/Atomic CSS library

Basscss Low-level CSS toolkit – the original Functional CSS library https://basscss.com Lightning-Fast Modular CSS with No Side Effects Basscss is a l

Basscss 5.8k Dec 31, 2022
A utility-first CSS framework for rapid UI development.

A utility-first CSS framework for rapidly building custom user interfaces. Documentation For full documentation, visit tailwindcss.com. Community For

Tailwind Labs 63.5k Jan 1, 2023
selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8.

Selectivizr CSS3 selectors for IE 6-8 selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explor

Keith Clark 1.7k Dec 18, 2022
A utility library to lookup TailwindCSS Heroicons by their name

Welcome to heroicons-lookup ?? A utility library to lookup TailwindCSS Heroicons by their name. Based on @jsmith's gist ?? Homepage ✨ Demo(coming soon

Nicolás Quiroz 8 Oct 3, 2022
A set of small, responsive CSS modules that you can use in every web project.

Pure A set of small, responsive CSS modules that you can use in every web project. http://purecss.io/ This project is looking for maintainers to suppo

Pure CSS 22.7k Jan 3, 2023
A small codebase to simulate environment of a real software engineering job built using html/css/js

How to setup your development environment? Before you can begin, you will need git, node, and a text editor. If you are running Windows, we recommend

JobSimulator 89 Dec 21, 2022
Deploying a React App (created using create-react-app) to GitHub Pages

Deploying a React App* to GitHub Pages * created using create-react-app Introduction In this tutorial, I'll show you how I deployed a React app—which

gitname 4.4k Dec 31, 2022
Fluent UI web represents a collection of utilities, React components, and web components for building web applications.

Fluent UI Web ?? ?? ?? Version 8 of @fluentui/react is now available on npm! ?? ?? ?? See the release notes for more info, and please file an issue if

Microsoft 14.5k Jan 4, 2023