aframe-proxy-event-component

A component to declaratively proxy events for A-Frame.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
aframe-proxy-event-component
2.1.04 years ago5 years agoMinified + gzip package size for aframe-proxy-event-component in KB

Readme

aframe-proxy-event-component

Version License
A component to declaratively proxy events for A-Frame.
For A-Frame.

API

| Property | Description | Default Value | | -------- | ----------- | ------------- | | captureBubbles | Whether to capture children's bubble events. | false | | enabled | Boolean used to toggle. If false, event will not be proxied. | true | | event | Event name to proxy. | '' | | from | Selector of entities to proxy event from. If set to PARENT, then will listen to parent for event. | '' | | to | Selector of entities to proxy event to. If set to CHILDREN, then the event is recursively proxied to all children. | '' | | as | Optional. Rename the event as the event is proxied to its target(s). | '' | | bubbles | Whether to bubble the proxied event. | false |

Installation

Browser

Install and use by directly including the browser files:
<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-proxy-event-component/dist/aframe-proxy-event-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity proxy-event="event: foo; to: a-scene; as: bar"></a-entity>
  </a-scene>
</body>

npm

Install via npm:
npm install aframe-proxy-event-component

Then require and use.
require('aframe');
require('aframe-proxy-event-component');