JSPM

@wordpress/compose

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 196413
  • Score
    100M100P100Q164928F
  • License GPL-2.0-or-later

WordPress higher-order components (HOCs).

Package Exports

  • @wordpress/compose

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wordpress/compose) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Compose

The compose package is a collection of handy Higher Order Components (HOCs) you can use to wrap your WordPress components and provide some basic features like: state, instance id, pure...

Installation

Install the module

npm install @wordpress/compose --save

Usage

import { withInstanceId } from '@wordpress/compose';

function WrappedComponent( props ) {
    return props.instanceId;
}

const ComponentWithInstanceIdProp = withInstanceId( WrappedComponent );

Refer to each Higher Order Component's README file for more details.



Code is Poetry.