@canner/canner-hoc

1.2.0 • Public • Published

canner-hoc

About

放置render-server的hoc, 和方便section開發使用的hoc

開發會用到的HOC

  • withDataSchema: 定義qa跟預設data

render-server的hoc

  • connectHOC: 把section用connect包起來return
  • connectMatchHOC: 一樣是包connect, 但是給Match使用
  • matchHOC: 包match
  • ppHOC: props proxy HOC, 單純把參數傳到section的HOC

Installation

$ npm install --save @canner/canner-hoc

Usage

import {withDataSchema} from '@canner/canner-hoc';


const component = ({title}) => {
  return <div>{title}</div>
};

export default withDataSchema({
  title: schema().rawData({
    qa: {
      description: "標題",
      type: 'string'
    },
    data: "預設標題文字"
  })
})(component);

build

webpack build兩個file

  • VAR js: dist/canner-hoc.js
  • min VAR js: dist/canner-hoc.min.js
$ npm run build

publish to s3

版本號會是package.json的version, 會把dist/canner-hoc.min.js傳到s3 ex: 版本為1.0.0, 傳上去為 https://s3-ap-northeast-1.amazonaws.com/static.canner.io/cannerHoc/1.0.0.min.js

$ npm run s3

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.00latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.00
1.1.00
1.0.160
1.0.150
1.0.140
1.0.130
1.0.121
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.21
1.0.10
1.0.00

Package Sidebar

Install

npm i @canner/canner-hoc

Weekly Downloads

2

Version

1.2.0

License

Apache-2.0

Last publish

Collaborators

  • wwwy3y3
  • cannerbot