/props-middleware

A middleware, responsible for passing static and dynamic component properties.

Primary LanguageJavaScriptMIT LicenseMIT

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>