0.6.0 • Published 7 years ago

react-utilities v0.6.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

react-utilities npm package GitHub issues Build Status Coverage Status

The missing react utility components.

Why anthor utility libary?

Whole document is in Gitbook now.

Installation

Using npm or yarn:

$ npm install --save react-utilities
or
$ yarn add react-utilities

Use CDN

Then with a module bundler like webpack, use as you would anything else.

// using ES6 modules
import {Delegate, Resolve, Debounce, Throttle} from 'react-utilities'

// or
import Resolve from 'react-utilities/Resolve'

// using CommonJS modules
var Delegate = require('react-utilities').Delegate

// CDN
var Delegate = reactUtilities.Delegate

Overview

Resolve

Resolve is a react component which resolve promise and pass the resolved value to children component when promise return. With Resolve you can wrap your pure, stateless component to connect them to remote data.

<Resolve name='user' promise={fetchUser(id)}>
  <User />
</Resolve>
// after fetch data `{id:1,name:'alice'}` it would render
<User user={{id:1,name:'alice'}} /> 

with Resolve, one can

  • Load remote data from server while rendering certain component.
  • Make your Component lazy load and use Code splitting in webpack. demo

Demo

https://github.com/zjuasmn/react-utilities/blob/master/resolve-demo.gif?raw=true

Delegate

Delegate is a component delegate rendering to other component.

Debounce

 Debounce is a react component to debounce certain properties to children component. So children component will render less frequently(if you make it pure).

Throttle

 Throttle is a react component to throttle certain properties to children component. So children component will render less frequently(if you make it pure).

0.6.0

7 years ago

0.5.4

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago