@nx-js/props-middleware
v1.0.0
Published
An NX middleware, responsible for injecting properties into reusable components.
Downloads
9
Maintainers
Readme
The props middleware
The props
middleware is responsible for injecting static or dynamic properties into reusable components.
- name: props
- middleware dependencies: attributes
- all middleware dependencies: observe, attributes
- type: component middleware
- docs
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>