All Projects → NekR → preact-delegate

NekR / preact-delegate

Licence: MIT License
Preact delegate DOM events

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to preact-delegate

Preact
⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
Stars: ✭ 30,527 (+179470.59%)
Mutual labels:  preact, dom
Val
VirtualDOM abstraction layer - give yourself better integration and full control over the DOM with any virtual DOM library that uses a Hyperscript-like API such as React and Preact.
Stars: ✭ 181 (+964.71%)
Mutual labels:  preact, dom
Goober
🥜 goober, a less than 1KB 🎉 css-in-js alternative with a familiar API
Stars: ✭ 2,317 (+13529.41%)
Mutual labels:  preact, dom
Ijk
Transforms arrays into virtual dom trees; a terse alternative to JSX and h
Stars: ✭ 452 (+2558.82%)
Mutual labels:  preact, dom
Vent
jQuery inspired DOM events library
Stars: ✭ 30 (+76.47%)
Mutual labels:  events, dom
Preact Portal
📡 Render Preact components in (a) SPACE 🌌 🌠
Stars: ✭ 160 (+841.18%)
Mutual labels:  preact, dom
Preact Markup
⚡️ Render HTML5 as VDOM, with Components as Custom Elements!
Stars: ✭ 167 (+882.35%)
Mutual labels:  preact, dom
Preact Worker Demo
Demo of preact rendering an entire app in a Web Worker.
Stars: ✭ 204 (+1100%)
Mutual labels:  preact, dom
Domtastic
Small, fast, and modular DOM and event library for modern browsers.
Stars: ✭ 763 (+4388.24%)
Mutual labels:  events, dom
Nanocomponent
🚃 - create performant HTML components
Stars: ✭ 355 (+1988.24%)
Mutual labels:  events, dom
bassdrum
reactive, type safe components with preact and rxjs.
Stars: ✭ 44 (+158.82%)
Mutual labels:  preact, dom
Bliss
Blissful JavaScript
Stars: ✭ 2,352 (+13735.29%)
Mutual labels:  events, dom
ngx-event-modifiers
Event Modifiers for Angular Applications https://netbasal.com/implementing-event-modifiers-in-angular-87e1a07969ce
Stars: ✭ 14 (-17.65%)
Mutual labels:  events, dom
use-bus
React hook to subscribe and dispatch events accros React components
Stars: ✭ 51 (+200%)
Mutual labels:  events
wishbone
A Python framework to build composable event pipeline servers with minimal effort.
Stars: ✭ 42 (+147.06%)
Mutual labels:  events
Prakma
Prakma is a framework to make applications using JSX, focusing on writing functional components.
Stars: ✭ 16 (-5.88%)
Mutual labels:  dom
lisk-builders
🛠️ A complete directory of Lisk delegates that also actively contribute
Stars: ✭ 17 (+0%)
Mutual labels:  delegate
events
📅 Upcoming events, conferences, meetups related to Open Source Design
Stars: ✭ 53 (+211.76%)
Mutual labels:  events
xmlresolver
The xmlresolver project provides an advanced implementation of the SAX EntityResolver (and extended EntityResolver2), the Transformer URIResolver, the DOM LSResourceResolver, the StAX XMLResolver, and a new NamespaceResolver. It uses the OASIS XML Catalogs V1.1 Standard to provide a mapping from external identifiers and URIs to local resources.
Stars: ✭ 31 (+82.35%)
Mutual labels:  dom
VBA-Userform-EventListener
🎉 A very easy way to add event listeners to a userform.
Stars: ✭ 17 (+0%)
Mutual labels:  events

preact-delegate

Delegate DOM events with Preact (since Preact doesn't do that by default).

Install

npm install preact-delegate --save-dev

Usage

Just wrap your root element from where to capture events with DelegateContainer and then wrap individual elements which should receive events with DelegateElement. See example:

import { Component } from 'preact';
import { DelegateContainer, DelegateElement } from 'preact-delegate';

class MyComponent extends Component {
  constructor(...args) {
    super(...args);

    this.onClick = (e) => {
      console.log(e.target);
    };
  }

  render({ items }) {
    return <DelegateContainer>
      <div class="my-component">
        {items.map(item => (
          <div class="my-item">
            <DelegateElement click={this.onClick}>
              <button type="button" class="my-button">{ item.text }</button>
            </DelegateElement>
          </div>
        ))}
      </div>
    </DelegateContainer>
  }
}

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].