1.1.0 • Published 8 years ago

monitortag v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

test dispatch 埋点

根据dispatch - > action 中的参数 tag 进行埋点

安装

npm i monitortag --save

使用

import monitor from 'monitortag'

在中间件中使用

let store = createStore(
        combineReducers(reducers),
        preloadedState,
        applyMiddleware(thunkMiddleware,monitor()),
    )

在页面中走action形式,type固定 @@monitor,如:

function fetchMonitor(ev){
    let target = ev.target;
    let actionTag = target.getAttribute('data-monitor');
    if(target.tagName === 'A' && actionTag){
        this.props.dispatch({
            type:'@@monitor',
            data:{
                actionTag
            }
        })
    }
}

License

ISC

1.1.0

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago