{"id":22694622,"url":"https://github.com/zjuasmn/react-utilities","last_synced_at":"2026-05-17T02:10:51.549Z","repository":{"id":57347288,"uuid":"81640554","full_name":"zjuasmn/react-utilities","owner":"zjuasmn","description":"The missing react utility components.","archived":false,"fork":false,"pushed_at":"2017-07-19T15:10:51.000Z","size":873,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T18:42:07.939Z","etag":null,"topics":["debounce","delegate","promise","react","react-component","resolver","throttle","utils"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zjuasmn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-11T08:26:25.000Z","updated_at":"2020-04-12T13:52:06.000Z","dependencies_parsed_at":"2022-08-28T03:51:59.682Z","dependency_job_id":null,"html_url":"https://github.com/zjuasmn/react-utilities","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjuasmn%2Freact-utilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjuasmn%2Freact-utilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjuasmn%2Freact-utilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjuasmn%2Freact-utilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zjuasmn","download_url":"https://codeload.github.com/zjuasmn/react-utilities/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246217987,"owners_count":20742295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debounce","delegate","promise","react","react-component","resolver","throttle","utils"],"created_at":"2024-12-10T03:08:55.714Z","updated_at":"2026-05-17T02:10:46.507Z","avatar_url":"https://github.com/zjuasmn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-utilities [![npm package][npm-badge]][npm] [![GitHub issues](https://img.shields.io/github/issues/zjuasmn/react-utilities.svg)](https://github.com/zjuasmn/react-utilities/issues) [![Build Status](https://travis-ci.org/zjuasmn/react-utilities.svg?branch=master)](https://travis-ci.org/zjuasmn/react-utilities) [![Coverage Status](https://coveralls.io/repos/github/zjuasmn/react-utilities/badge.svg?branch=master)](https://coveralls.io/github/zjuasmn/react-utilities?branch=master)\n\n[npm-badge]: https://img.shields.io/npm/v/react-utilities.svg?style=flat-square\n[npm]: https://www.npmjs.org/package/react-utilities\n\nThe missing react utility components. \n\n[Why anthor utility libary?](docs/why.md)\n\nWhole document is in [Gitbook](https://zjuasmn.gitbooks.io/react-utilities/content/) now.\n\n## Installation\n\nUsing [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/):\n\n```\n$ npm install --save react-utilities\nor\n$ yarn add react-utilities\n```\n\nUse CDN\n\n- Assuming `React` has already imported.\n- Then include [https://unpkg.com/react-utilities/umd/react-utilities.js](https://unpkg.com/react-utilities/umd/react-utilities.js) (namespace `reactUtilities`)\n\n\nThen with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else.\n\n```js\n// using ES6 modules\nimport {Delegate, Resolve, Debounce, Throttle} from 'react-utilities'\n\n// or\nimport Resolve from 'react-utilities/Resolve'\n\n// using CommonJS modules\nvar Delegate = require('react-utilities').Delegate\n\n// CDN\nvar Delegate = reactUtilities.Delegate\n```\n\n## Overview\n\n### Resolve\n  `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.\n  \n```jsx\n\u003cResolve name='user' promise={fetchUser(id)}\u003e\n  \u003cUser /\u003e\n\u003c/Resolve\u003e\n// after fetch data `{id:1,name:'alice'}` it would render\n\u003cUser user={{id:1,name:'alice'}} /\u003e \n```\n\nwith  `Resolve`, one can \n\n- Load remote data from server while rendering certain component.\n- Make your `Component` lazy load and use Code splitting in webpack.  [demo](demo/webpack-codesplitting-lazyload)\n\n### Demo\n![https://github.com/zjuasmn/react-utilities/blob/master/resolve-demo.gif?raw=true](https://github.com/zjuasmn/react-utilities/blob/master/resolve-demo.gif?raw=true)\n\n### Delegate\n  `Delegate` is a component delegate rendering to other component.\n\n\n### Debounce\n  `Debounce` is a react component to [`debounce`](https://lodash.com/docs#debounce) certain properties to children component. So children component will render less  frequently(if you make it pure).\n\n\n### Throttle\n  `Throttle` is a react component to [`throttle`](https://lodash.com/docs#throttle) certain properties to children component. So children component will render less  frequently(if you make it pure).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzjuasmn%2Freact-utilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzjuasmn%2Freact-utilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzjuasmn%2Freact-utilities/lists"}