1.1.5 • Published 2 years ago

stimulus-existence v1.1.5

Weekly downloads
176
License
MIT
Repository
gitlab
Last release
2 years ago

Stimulus Existence

Stimulus controller to remove elements from the dom, and be notified with an event when they are added.

Installation

$ yarn add stimulus-existence

Usage

Register the controller with Stimulus:

// application.js
import { Application } from "@hotwired/stimulus";
import { ExistenceController } from "stimulus-existence";

const application = Application.start();
application.register("existence", ExistenceController);

Initialize the controller on a container element, use the remove() action to delete the entire container. Listen to existence:added events to discover when your container has been added to the dom. Useful for Rails Ujs Dom HTML additions, and hooking up with other controllers.

<div
  data-controller="existence"
  data-action="existence:added->other-controller#doSomething"
>
  <button data-action="click->existence#remove">Close me</button>
</div>

Contributing

Fork the project.

Install dependencies

$ yarn install

Write some tests, and add your feature. Send a PR.

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago