/attributes-middleware

An NX middleware, responsible for handling reactive and custom attributes.

Primary LanguageJavaScriptMIT LicenseMIT

The attributes middleware

The attributes middleware extends native attributes with dynamic behavior and provides a way to add custom attributes.

  • name: attributes
  • direct middleware dependencies: observe
  • all middleware dependencies: observe
  • type: component or content middleware
  • ignores: text nodes
  • docs

Installation

npm install @nx-js/attributes-middleware

Usage

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

component()
  .useOnContent(observe)
  .useOnContent(attributes)
  .register('attributes-comp')
<attributes-comp>
  <span @hidden="!show">Hello World!</span>
</animated-comp>