New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-with-async-state

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-with-async-state

React redux high order component that waits for redux state to meet a condition before rendering the real component.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

React withAsyncState()

A React high-order Component designed to abstract the fetch, wait, check flow of remote or asynchronous requests or Redux Thunk actions. The goal is to make it a drop in component that connects to the store, rendering the TargetComponent only when the state is in shape.

Install

$ npm install react-with-async-state --save

API

withAsyncState( Component, Wait, Error, Function )

Usage


export default connect(
  mapStateToProps,
  mapDispatchToProps
)(
  withAsyncState(
    AComponentThatNeedsSomethingBeforeRendering,
    Loader,
    ErrorMessage,
    (props) => !!_.size(props.items)
  )
);


Keywords

react

FAQs

Package last updated on 05 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts