{"id":21822681,"url":"https://github.com/unirakun/hoc-react-loader","last_synced_at":"2025-04-14T03:52:52.380Z","repository":{"id":43121756,"uuid":"65548817","full_name":"unirakun/hoc-react-loader","owner":"unirakun","description":"Calls the load function from props at mount","archived":false,"fork":false,"pushed_at":"2022-12-09T17:10:42.000Z","size":2607,"stargazers_count":32,"open_issues_count":29,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-10T16:15:00.406Z","etag":null,"topics":["hoc","indicator","loader","loading","nantes","react","zenika"],"latest_commit_sha":null,"homepage":"https://alakarteio.github.io/hoc-react-loader/","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/unirakun.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":"2016-08-12T11:36:15.000Z","updated_at":"2021-11-18T16:36:25.000Z","dependencies_parsed_at":"2023-01-25T22:45:34.384Z","dependency_job_id":null,"html_url":"https://github.com/unirakun/hoc-react-loader","commit_stats":null,"previous_names":["alakarteio/hoc-react-loader"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unirakun%2Fhoc-react-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unirakun%2Fhoc-react-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unirakun%2Fhoc-react-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unirakun%2Fhoc-react-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unirakun","download_url":"https://codeload.github.com/unirakun/hoc-react-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819359,"owners_count":21166474,"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":["hoc","indicator","loader","loading","nantes","react","zenika"],"created_at":"2024-11-27T17:16:50.618Z","updated_at":"2025-04-14T03:52:52.349Z","avatar_url":"https://github.com/unirakun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hoc-react-loader\n[![CircleCI](https://circleci.com/gh/unirakun/hoc-react-loader.svg?\u0026style=shield)](https://circleci.com/gh/unirakun/hoc-react-loader/tree/master) [![NPM Version](https://badge.fury.io/js/hoc-react-loader.svg)](https://www.npmjs.com/package/hoc-react-loader) [![Coverage Status](https://coveralls.io/repos/github/unirakun/hoc-react-loader/badge.svg?branch=master)](https://coveralls.io/github/unirakun/hoc-react-loader?branch=master)\n\nThis is a [higher order component](https://facebook.github.io/react/docs/higher-order-components.html) (\"HOC\"). It's an advanced pattern used in React that let you reuse code logic, it can be summarized as a component factory. It improves isolation, interoperability and maintainability of your code base.\n\n**hoc-react-loader**'s purpose is to call a `load` callback passed through the `props` of a component only once (at `componentWillMount`). This is convenient to load data from a backend for instance. The component shows a loading indicator when it's waiting for the props to be defined. The loading indicator can be changed easily.\n\n - To see full documentation: [click here](./packages/core/README.md)\n - Do you want a default LoadingIndicator and a default ErrorIndicator?, you can use [@hoc-react-loader/full](./packages/full/README.md)\n - You want your bundle not being bloated?, you can use [@hoc-react-loader/core](./packages/core/README.md)\n\n## Example\n```jsx\nimport React from 'react'\nimport loader from '@hoc-react-loader/core'\n\nconst Component = ({ data }) =\u003e \u003cdiv\u003eComponent {JSON.stringify(data)}\u003c/div\u003e\nconst load = props =\u003e console.log(props)\n\nexport default loader({ print: ['data'], load })(Component)\n```\n\nIn this example `load` will be called at first mount, then the wrapped `Component` will be printed only if `props.data` is truthy.\n\n`load` function can be the moment you ask for your API data.\n\n## Demos\nYou can test some examples [here](https://unirakun.github.io/hoc-react-loader/).\n\n# About uni rakun\n**uni rakun** is created by two passionate french developers.\n\nDo you want to contact them ? Go to their [website](https://unirakun.fr)\n\n\u003ctable border=\"0\"\u003e\n \u003ctr\u003e\n  \u003ctd align=\"center\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/26094222?s=460\u0026v=4\" width=\"100\" /\u003e\u003c/td\u003e\n  \u003ctd align=\"center\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/17828231?s=460\u0026v=4\" width=\"100\" /\u003e\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n  \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/guillaumecrespel\"\u003eGuillaume CRESPEL\u003c/a\u003e\u003c/td\u003e\n  \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/fabienjuif\"\u003eFabien JUIF\u003c/a\u003e\u003c/td\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funirakun%2Fhoc-react-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funirakun%2Fhoc-react-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funirakun%2Fhoc-react-loader/lists"}