@nx-js/ref-middleware

An NX middleware, responsibe for handling internal references.

Usage no npm install needed!

<script type="module">
  import nxJsRefMiddleware from 'https://cdn.skypack.dev/@nx-js/ref-middleware';
</script>

README

The ref middleware

The ref middleware is responsible for handling internal references.

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

Installation

npm install @nx-js/ref-middleware

Usage

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

component()
  .useOnContent(observe)
  .useOnContent(attributes)
  .useOnContent(ref)
  .register('nav-comp')
<nav-comp>
  <a iref="profile">Profile</a>
  <a iref="settings">Settings</a>
</nav-comp>