Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 947 Bytes

README.md

File metadata and controls

32 lines (24 loc) · 947 Bytes

The props middleware

The props middleware is responsible for injecting static or dynamic properties into reusable components.

Installation

npm install @nx-js/props-middleware

Usage

const component = require('@nx-js/core')
const observe = require('@nx-js/observe-middleware')
const attributes = require('@nx-js/attributes-middleware')
const props = require('@nx-js/props-middleware')

component()
  .use(observe)
  .use(attributes)
  .use(props('name', 'age', 'items'))
  .register('props-comp')
<props-comp name="Bob" age="12" @items="myItems">Hello World!</props-comp>