# tunk-isolate

> 数据传入store和从store取出的时候实现引用隔离，避免误操作引起非预期的数据变更

Latest version **3.0.0** (published 2017-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install tunk-isolate
pnpm add tunk-isolate
yarn add tunk-isolate
bun add tunk-isolate
```

## 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 | 3.0.0 |
| Published | 2017-12-04 |
| First published | 2017-12-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | steven chen |
| Maintainers | stevencjc |

## Links

- npm: https://www.npmjs.com/package/tunk-isolate
- npm.io page: https://npm.io/package/tunk-isolate

## Recent versions

- 3.0.0 (latest) — 2017-12-04

## README

# tunk-isolate

数据传入store和从store取出的时候实现引用隔离，避免误操作引起非预期的数据变更

## Usage
````shell
npm install tunk-isolate
````
````javascript
import isolate from 'tunk-isolate'
tunk.use(isolate);
````
## Config    isolate : ['deep' | 'shallow' | 'none']  default:'deep'
````javascript
// 全局配置debug，默认为 false
tunk.config({isolate: 'none'});

// 精确到模块配置是否debug
@create({isolate: 'deep'})
class demo {
    constructor(){
        ....
    }
    // 精确到某个动作配置是否debug
    @action({isolate: 'shallow'})
    sayHi(){
        ...
    }

}

````

#### deep
深克隆，隔离所有引用
```javascript 
JSON.parse(JSON.stringify(obj));
````
#### shallow
浅克隆，创建表层对象 
```javascript 
Object.assign({}, obj);
````
#### none
不克隆，无隔离，效率最高

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