# parcial

> kind of multimethods

Latest version **1.1.1** (published 2014-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install parcial
pnpm add parcial
yarn add parcial
bun add parcial
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2014-10-04 |
| First published | 2014-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Matt Brennan |
| Maintainers | quarterto |

## Links

- npm: https://www.npmjs.com/package/parcial
- Repository: https://github.com/quarterto/Parcial
- Issues: https://github.com/quarterto/Parcial/issues
- npm.io page: https://npm.io/package/parcial

## Dependencies (1)

- [es6-symbol](https://npm.io/package/es6-symbol.md) ^0.1.0

## Recent versions

- 1.1.1 (latest) — 2014-10-04
- 1.1.0 — 2014-10-04
- 1.0.0 — 2014-10-04

## README

<p align="center">
# Parcial <br>![Build Status](https://travis-ci.org/quarterto/Parcial.svg)](https://travis-ci.org/quarterto/Parcial)
</p>

Tagged partial methods, like:

```javascript
var a = parcial('b');

try { a.b() }
catch(e) { ok(e.message == 'unimplemented') }

a.b = {tag: function() { return "you're it" }};
a.b('tag'); //⇒ "you're it"

a.b = {another: function(a) { return a * 2 }};
a.b('another', 5); //⇒ 10

a.b = {tag: function() { return "you got me" }};
a.b('tag'); //⇒ "you got me"
```

## api
#### `parcial(name, options = {strict: true})`
Returns an object with a getter and setter for the method `name`. If `options.strict` is false, the method does not throw an exception if it encounters a tag it doesn't know about.

## why

Parcial works great with mixins. No need to do a deep merge; just use partials:

```javascript
var base = parcial('method');

var a = {method: {a: function() { return 'a' }}};
var b = {method: {b: function() { return 'b' }}};
var c = {method: {c: function() { return 'c' }}};

var agg = xtend({}, base, a, b, c);
agg.method('a'); //⇒ 'a'
agg.method('b'); //⇒ 'b'
agg.method('c'); //⇒ 'c'
```

## Licence
MIT. &copy; 2014 Matt Brennan

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