1 | import _ from './wrap/lodash'
|
2 | import * as quibble from 'quibble'
|
3 | import store from './store'
|
4 |
|
5 | const onResetHandlers = []
|
6 | let onNextResetHandlers = []
|
7 |
|
8 | export default _.tap(() => {
|
9 | store.reset()
|
10 | quibble.reset()
|
11 | _.each(onResetHandlers, (resetHandler) =>
|
12 | resetHandler())
|
13 | _.each(onNextResetHandlers, (resetHandler) =>
|
14 | resetHandler())
|
15 | onNextResetHandlers = []
|
16 | }, (reset) => {
|
17 | reset.onReset = (func) =>
|
18 | onResetHandlers.push(func)
|
19 |
|
20 | reset.onNextReset = (func) =>
|
21 | onNextResetHandlers.push(func)
|
22 | })
|