# composens

> A name spaced compose function to avoid prop collision

Latest version **1.0.3** (published 2017-10-11) · ISC license · 0 weekly downloads

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

## Install

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

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2017-10-11 |
| First published | 2017-04-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Jeffrey Burt |
| Maintainers | jephuff |
| Keywords | react, higher-order, components, microcomponentization, utilities, composition |

## Links

- npm: https://www.npmjs.com/package/composens
- Repository: https://github.com/jephuff/composeNS
- Homepage: https://github.com/jephuff/composeNS#readme
- Issues: https://github.com/jephuff/composeNS/issues
- npm.io page: https://npm.io/package/composens

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2017-10-11
- 1.0.2 — 2017-10-11
- 1.0.1 — 2017-04-24
- 0.0.9 — 2017-04-17
- 0.0.8 — 2017-04-13
- 0.0.7 — 2017-04-12
- 0.0.6 — 2017-04-12
- 0.0.5 — 2017-04-12
- 0.0.4 — 2017-04-12
- 0.0.3 — 2017-04-12
- 0.0.2 — 2017-04-12
- 0.0.1 — 2017-04-12

## README

# composeNS

> Namespaces are one honking great idea -- let's do more of those!

composeNS is namespaced compose function that can be used with recompose to avoid prop name collision. 

[![build status](https://img.shields.io/travis/Jephuff/composeNS/master.svg?style=flat-square)](https://travis-ci.org/Jephuff/composeNS)
[![npm version](https://img.shields.io/npm/v/composens.svg?style=flat-square)](https://www.npmjs.com/package/composens)
[![npm downloads](https://img.shields.io/npm/dm/composens.svg?style=flat-square)](https://www.npmjs.com/package/composens)

## Usage

```js
compose(
  opts: string | { namespace: string, propMap: Array<string> | { [string]: string } },
  ...functions: Array<Function>,
): Function
```

#### Usage to namespace a portion of a group of HOC

```js
import ReactDOM from 'react-dom'
import { compose, withProps, mapProps, withState } from 'recompose';
import composeNS from 'composens';

const App = compose(
  withState('state', 'setState', { location: 'france' }),
  composeNS(
    {
      namespace: 'toulon',
      propMap: { 'state': 'parentState' }, // you can still access props passed in using a the propMap option that is a array of props you want passed in, or an object `{ key: alias }`
    },
    withState('state', 'setState', { prisoner: 24601 })
    mapProps(props => ({ description: `location: ${props.parentState.location}, prisoner: ${props.state.prisoner}` }))
  )
)((props) => <div>description: {props.toulon.description}</div>);

ReactDom.render(<App />, document.querySelector('#container'));
```

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