1.1.0 • Published 7 years ago

monitortag v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 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

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago