• This repository has been archived on 08/Jul/2023
  • Stars
    star
    2,011
  • Rank 22,096 (Top 0.5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🍱 Higher-Order Components for React

@hocs

ci coverage

A collection of Higher-Order Components for React, especially useful with Recompose.

A Higher-Order Component is a function that takes a component and returns a new component.

Packages

Universal

🚱 omit-props

Helps to omit unnecessary context, state setters or anything else you don't want to propagate with {...spread}.

♻️ with-lifecycle

Provides a handy way to use some of React Component Lifecycle methods.

βŒ› debounce-handler

Helps to debounce handlers like onChange.

βŒ› throttle-handler

Helps to throttle handlers like onChange.

⌚ safe-timers

Provides safe versions of setTimeout, setInterval, requestAnimationFrame and requestIdleCallback which will be cleared/cancelled automatically before component is unmounted.

πŸ”” with-callback-on-change

Invokes a callback on prop change, useful to decouple side effects like onChange handler in a declarative way.

πŸ”” with-callback-on-change-while

Invokes a callback on prop change while condition is true, useful to decouple side effects like onChange handler in a declarative way and control loops.

πŸ”” with-callback-once

Invokes a callback once condition is true (while previous check was false), useful to decouple side effects like onSuccess or onError handlers in a declarative way.

πŸ” with-log

Injects console.log with props or any custom message into render.

πŸ” with-debugger

Injects debugger into render.

Browser

↔️ with-match-media-props

Dynamically map CSS Media Queries matches to boolean props using window.matchMedia() (Can I use?).

↔️ with-resize-observer-props

Dynamically map component size and position changes to props using Resize Observer API (Can I use? πŸ™ˆ).

πŸ‘€ with-intersection-observer-props

Dynamically map visibility of a component to boolean props using Intersection Observer API (Can I use?).

πŸ™ˆ with-page-visibility-props

Dynamically map page visibility status to props using Page Visibility API (Can I use?).

πŸ”Œ with-online-status-props

Dynamically map online/offline status to props using navigator.onLine (Can I use?).

β›” prevent-handlers-default

Decouples e.preventDefault() side effect from handlers like form submitting or clicking a link.

React Native

↔️ with-view-layout-props

Dynamically map View layout dimensions to props using onLayout() handler.

…and more to come

You can follow me on Twitter for updates.

Development

  1. Create a new folder in packages/, let's say with-foo.
  2. See package.json in already existing packages and create new with-foo/package.json.
  3. Put source code in with-foo/src/, it will be transpiled and bundled into with-foo/dist/, with-foo/lib/ and with-foo/es/.
  4. Put tests written with Jest in with-foo/test/.
  5. Put demo in with-foo/demo/, it will be rendered and wrapped with HMR.

Available commands using Start:

yarn start build <package>
yarn start demo <package>
yarn start test
yarn start testWatch
yarn start lint

More Repositories

1

foxr

🦊 Node.js API to control Firefox
TypeScript
797
star
2

start

πŸ”΄ Functional task runner for Node.js
TypeScript
475
star
3

chromium-headless-remote

🐳 Dockerized Chromium in headless remote debugging mode
Makefile
125
star
4

isparta-loader

πŸ’― isparta instrumenter loader for webpack
JavaScript
117
star
5

microjungle

🏭 HTML templating with JS. The Right Way.
JavaScript
91
star
6

baggage-loader

[MAINTAINER NEEDED] πŸ‘œ Webpack loader to automatically require any resources related to the required one
JavaScript
88
star
7

autopolyfiller-loader

🏭 Autopolyfiller loader for webpack
JavaScript
69
star
8

valya

βœ”οΈ Higher-Order Component for validation in React
JavaScript
63
star
9

Monokai-Soda-iTerm

🌈 Sublime Text 2 Soda Dark based theme for iTerm/iTerm2
47
star
10

mustache-loader

Mustache loader for webpack
JavaScript
39
star
11

mnth

πŸ“† Calendar month as 2d array of Dates
TypeScript
38
star
12

babel-istanbul-loader

πŸ’― babel-istanbul instrumenter loader for webpack
JavaScript
25
star
13

poncho

Client-side JS code coverage using PhantomJS, Mocha and Blanket
JavaScript
23
star
14

typeon

βœ”οΈ Typed JSON parse and stringify for TypeScript
TypeScript
22
star
15

jquery-pointerevents

Basic polyfill for Pointer Events W3C Specification
JavaScript
20
star
16

firefox-headless-remote

🐳 Dockerized Firefox in headless Marionette mode
JavaScript
16
star
17

markdown-highlight-loader

🏭 Markdown (marked + highlight.js) loader for webpack
JavaScript
11
star
18

babel-register-ts

πŸ”§ @babel/register wrapper with additional .ts and .tsx extensions
JavaScript
10
star
19

mocku

πŸ•ΆοΈ ESM mocking library
TypeScript
9
star
20

nbx

▢️ Execute package binaries
Shell
8
star
21

react-attrs-filter

Filter React props
JavaScript
8
star
22

copie

πŸ‘―β€β™€οΈ Copy a file
TypeScript
7
star
23

1pwd

πŸ”‘ 1Password CLI wrapper
TypeScript
6
star
24

ungoogled-chromium-headless-remote

🐳 Dockerized Ungoogled Chromium in headless remote debugging mode
Dockerfile
6
star
25

auto

TypeScript
4
star
26

ekst

πŸ”‘ Append, prepend, replace or remove basename extensions
TypeScript
4
star
27

dleet

πŸ”₯ Delete directories and files
TypeScript
4
star
28

spyfn

πŸ‘€ Spy function
TypeScript
4
star
29

makethen

✨ Promisify Node.js-style callbacks with native Promise
TypeScript
4
star
30

codecov-node-lite

πŸ’― LCOV uploader for codecov.io service
TypeScript
4
star
31

flows

γ€° A proof of concept of alternative Flow Library Definitions manager
JavaScript
4
star
32

eslint-config-tough

[ DEPRECATED ]
JavaScript
4
star
33

itc

iTunes ITC files parser and covers extractor
JavaScript
3
star
34

bsc

πŸ” Binary search with comparator
TypeScript
3
star
35

dba

Don't Be an Asshole
JavaScript
3
star
36

lessbuildify

Browserify plugin for compiling Less to the external file
JavaScript
3
star
37

yocto

chainable all the default DOM Element methods and properties
JavaScript
3
star
38

_

βš™οΈ Personal configs, presets, etc
TypeScript
3
star
39

move-path

➑️ Move path to destination folder
TypeScript
3
star
40

get-local-ip

Get a local IP address from a specified network range
JavaScript
2
star
41

karma-saucelabs-browsers

Autoprefixer-like browsers matching for Karma + SauceLabs
JavaScript
2
star
42

grunt-freeport

πŸ†“ Grunt task to get a free port number on localhost from specified range
JavaScript
2
star
43

txt

🚧 my WIP dreams
TypeScript
1
star
44

jquery-pointerpressrelease

Additional 'pointerpress' and 'pointerrelease' events on top of jquery-pointerevents
JavaScript
1
star
45

deepsweet

1
star
46

deepsweet.github.io

🌐
HTML
1
star
47

chrome.theoldreader.notifier

Displays the number of unread RSS items of The Old Reader
JavaScript
1
star