# monican

> A Monican conspiracy

Latest version **1.0.4** (published 2016-09-02) · MIT license · 0 weekly downloads

## Install

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

## 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.0.4 |
| Published | 2016-09-02 |
| First published | 2016-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | TransferGo Ltd |
| Maintainers | emilis-go |
| Keywords | flux, react, reactjs, component, stores, actions |

## Links

- npm: https://www.npmjs.com/package/monican
- Repository: https://github.com/TransferGo/monican
- Homepage: https://github.com/TransferGo/monican#readme
- Issues: https://github.com/TransferGo/monican/issues
- npm.io page: https://npm.io/package/monican

## Dependencies (5)

- [flux](https://npm.io/package/flux.md) ^2.1.1
- [ramda](https://npm.io/package/ramda.md) ^0.22.1
- [react](https://npm.io/package/react.md) ^0.14.0 || ^15.0.0
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.11.6
- [object-assign](https://npm.io/package/object-assign.md) ^4.1.0

## 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.4 (latest) — 2016-09-02
- 1.0.7 (prerelease) — 2016-11-07
- 1.0.6 — 2016-11-07
- 1.0.5 — 2016-11-07
- 1.0.3 — 2016-09-02
- 1.0.2 — 2016-08-31
- 1.0.1 — 2016-08-26
- 1.0.0 — 2016-08-19

## README

# A Monican Conspiracy

This is not a framework. Just like React.

It lets one create _Actions_ and _Stores_ that are mounted/unmounted with a parent _View_.

## Installation

``` 
npm install monican
```

## Usage

### Example

```javascript
import React, { PropTypes } from 'react';
import { render } from 'react-dom';
import { View } from 'monican';

const ChildView = View({

    displayName: 'YourChildView',

    actionsUse: {
        /// Action group
        parentActions: {
            /// Action name and the type of it's argument:
            onClickSomething: PropTypes.any,
        },
    },

    storesUse: {
        /// Store name
        parentStore: {
            /// Store value name and its type:
            clickCounter: PropTypes.number,
        },
    },

    render() {
        return (
            <button onClick={ this.actions.parentActions.onClickSomething }>
                Click me ({ this.props.parentStore.clickCounter })
            </button>
        );
    },
});

const parentActions = {
    onClickSomething: PropTypes.any,
};

const parentStore = {

    getInitialState() {
        return { clickCounter: 0 };
    },

    getActionHandlers() {
        return {
            parentActions: {
                onClickSomething: this.onClickSomething,
            },
        };
    },

    onClickSomething(arg, { state }) {
        return { clickCounter: state.clickCounter + 1 };
    },
};

const ParentView = View({

    displayName: 'YourParentView',

    actionsCreate: {
        parentActions: parentActions,
    },

    storesCreate: {
        parentStore: parentStore,
    },

    render() {
        return (
            <div>
                <h2>Parent view</h2>
                <p>{
                    'Button has been clicked: ' +
                    this.props.parentStore.clickCounter +
                    ' times.'
                }</p>
                <ChildView/>
            </div>
        );
    },
});

const div = document.createElement('div');
render(<ParentView/>, div);
document.body.appendChild(div);
```

## License

A Monican Conspiracy is MIT licensed.

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