An open API service indexing awesome lists of open source software.

https://github.com/statikbe/npm-helpers


https://github.com/statikbe/npm-helpers

Last synced: over 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# @statikbe/helpers

https://www.npmjs.com/package/@statikbe/helpers

## Installation

```
npm install @statikbe/helpers
yarn add @statikbe/helpers
```

## Usage

```
import { toArray } from '@statikbe/helpers';

toArray(document.querySelector('.my-class'));
```

## Methods

| method | description | returns |
| --- | --- | --- |
| `isIterable(obj)` | Checks if `obj` is iterable. | `Boolean` |
| `toArray(obj)` | Converts iterable object to array, if not iterable creates array containing `obj`. | `Array` |
| `toggle(elements [, display])` | Shows or hides target element(s). | - |
| `trigger(elements, eventName)` | Trigger an event on element(s). | - |