diff --git a/package.json b/package.json index 6a84a69..3757142 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zlp", - "version": "1.0.4", + "version": "1.0.5", "description": "single react data flow tools", "main": "lib/index.js", "scripts": { diff --git a/readme.md b/readme.md index 8ac271c..a5da3e2 100644 --- a/readme.md +++ b/readme.md @@ -34,7 +34,7 @@ import { connect } from 'zlp' import a from '/store/a' // 一个组件可以绑定多个 store a\b\c 都是 store 示例 -@connect(a, b, c) +@connect([a, b, c]) class Index extends React.Component { render () { return ( diff --git a/src/connect.tsx b/src/connect.tsx index 17c17b7..e972721 100644 --- a/src/connect.tsx +++ b/src/connect.tsx @@ -6,7 +6,7 @@ interface ConnectStore { handle?: () => void } -export default function connect (stores: Store[] | any): any { +export default function connect (stores: any | Store[]): any { let arr: Store[] = [] if (Array.isArray(stores)) { arr = stores diff --git a/src/store.ts b/src/store.ts index 17fdf7f..b29285c 100644 --- a/src/store.ts +++ b/src/store.ts @@ -11,7 +11,6 @@ class Store { protected setStore (path, value) { set(this.store, path, value) - this.store[path] = value this.emit('change') }