# tigajs

> A react-like libray, integration react-router, redux, create model base on redux

Latest version **0.0.9** (published 2018-10-25) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2018-10-25 |
| First published | 2018-10-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 255.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | kaishen |

## Links

- npm: https://www.npmjs.com/package/tigajs
- Repository: https://gitlab.kaishens.cn/web/tiga
- npm.io page: https://npm.io/package/tigajs

## Dependencies (6)

- [warning](https://npm.io/package/warning.md) ^4.0.2
- [invariant](https://npm.io/package/invariant.md) ^2.2.4
- [value-equal](https://npm.io/package/value-equal.md) ^0.4.0
- [redux-persist](https://npm.io/package/redux-persist.md) ^5.10.0
- [resolve-pathname](https://npm.io/package/resolve-pathname.md) ^2.2.0
- [hoist-non-react-statics](https://npm.io/package/hoist-non-react-statics.md) ^2.5.5

## Recent versions

- 0.0.9 (latest) — 2018-10-25
- 0.0.8 — 2018-10-24
- 0.0.7 — 2018-10-24
- 0.0.6 — 2018-10-24
- 0.0.5 — 2018-10-24
- 0.0.4 — 2018-10-24
- 0.0.3 — 2018-10-24
- 0.0.2 — 2018-10-24

## README

# Installation
`npm install tigajs`

## Basic Used
```js
import TIGA from "tigajs";

const App = () => {
    return <p>Hello, Tiga</p>
};

TIGA.render(<App/>, document.getElementById('root'));
```

## Router
```js
import TIGA, {Route, Switch, HashRouter} from "tigajs";

const element = (<HashRouter>
    <Switch>
        <Route path='/a' component={<p>Is A!</p>}/>
        <Route path='/' exact component={<div>Is index!</div>}/>
    </Switch>
</HashRouter>);

TIGA.render(element, document.getElementById('root'));
```

## Use Redux base on Model
`app.js`
```js
import TIGA, {Route, Switch, HashRouter, createModel, modelStart} from "tigajs";

import global from './model/global.js';
import Welcome from './Welcome.js';

createModel(global);

modelStart(
    <Welcome/>,
    'root'
);
```

`/model/global.js`
```js
export default {
    namespace: 'global',
    state: {
        content: 'Hello'
    },
    epics: {
    },
    reducers: {
        goodbye(state, action) {
            return {
                ...state,
                content: 'goodbye'
            };
        }
    }
}
```

`Welcome.js`
```js
import TIGA, {Component, withRouterConnectModel} from "tigajs";

class Welcome extends Component {
    constructor(props) {
        super(props);
    }

    onClick() {
        this.props.dispatch({
            type: 'global/goodbye'        
        })
    }

    render() {
        return (
            <button onClick={() => this.onClick()}>back</button>
        );
    }
}

export default withRouterConnectModel(Welcome, 'global');
```

## redux store storage
```js
createModel(global, true);
```

## config babel
use `babel-plugin-transform-tiga-jsx`

Tiga is inspired by the following projects:

* react
* react-router
* redux
* react-redux

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