# dominate-core

> Pass items through a chain filters.

Latest version **4.0.0** (published 2017-09-18) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install dominate-core
pnpm add dominate-core
yarn add dominate-core
bun add dominate-core
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2017-09-18 |
| First published | 2016-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jon Anderson |
| Maintainers | chronzerg |

## Links

- npm: https://www.npmjs.com/package/dominate-core
- Repository: https://github.com/chronzerg/Dominate-Core
- Homepage: https://github.com/chronzerg/Dominate-Core#readme
- Issues: https://github.com/chronzerg/Dominate-Core/issues
- npm.io page: https://npm.io/package/dominate-core

## Recent versions

- 4.0.0 (latest) — 2017-09-18
- 3.0.0 — 2017-08-13
- 2.0.0 — 2017-01-21
- 1.0.3 — 2017-01-21
- 1.0.2 — 2017-01-21
- 1.0.1 — 2016-12-17
- 1.0.0 — 2016-07-04

## README

# Dominate-Core
Daisy chain filtering

Dominate is a JavaScript framework for filtering arrays of items. A Dominate instance is made up of an InputNode, OutputNode, and a chain of Filters connecting them. The InputNode allows your application to supply Dominate with the original array of items to be filtered. Each filter then subsequently removes 0 or more items before passing it on to the next filter in the chain. Finally, the OutputNode provides your application with the array of items which made it through the filters.

## API
### Constructor
```javascript
let instance = require('dominate-core')(inputNode, outputNode);
```
Creates a new Dominate instance. The InputNode and OutputNode must be supplied at construction time

### Adding Filters
```javascript
let filterApi = instance.addFilter(FilterFactory, options);
```
Adds a new instance of a filter to the filter chain. `FilterFactory` is the filter's constructor function. `options` is the options for this filter instance. The return value is the filter instance's "api object". This object may contain variables and functions which control the filter's behavior. The api object is also used to remove the filter from the instance of the framework.

### Removing Filters
```javascript
instance.removeFilter(filterApi);
```
Removes a filter instance from the filter chain. `filterApi` is the filter's api object returned when the filter was added.

### Updating the OutputNode
```javascript
instance.update();
```
Forces an update of the OutputNode. Normally, filters only refilter content when they detect a relevant change. Calling this function forces all the filters to refilter the content.

## Examples
To see an usage examples and implementations of input nodes, output notes, and filters, check out the [test code](test).

---
_Source: https://npm.io/package/dominate-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
