@canner/page-wrapper

0.3.0 • Public • Published

page-wrapper NPM version Dependency Status

some common methods for template pages

Installation

$ npm install --save @canner/page-wrapper

Usage

const wrapper = require('@canner/page-wrapper');

class PageInner extends Component {
  static propTypes = {
    foo: PropTypes.string
  };

  render() {
    const {foo} = this.props;
    return (
      <div>
        inner, value foo: {foo}
      </div>
    );
  }
}

const PageInnerWrapper = wrapper()(PageInner);

// or decorator method

@wrapper
class PageInner extends Component {
  static propTypes = {
    foo: PropTypes.string
  };

  render() {
    const {foo} = this.props;
    return (
      <div>
        inner, value foo: {foo}
      </div>
    );
  }
}

Usage

This library is really small, look into source code. see src/index.js for details.

Start example server

node devServer.js

License

Apache-2.0 © chilijung

Readme

Keywords

Package Sidebar

Install

npm i @canner/page-wrapper

Weekly Downloads

0

Version

0.3.0

License

Apache-2.0

Unpacked Size

7.64 kB

Total Files

4

Last publish

Collaborators

  • wwwy3y3
  • cannerbot