( store: Store<State>, methodName: string, nodeSet: CommonUnit | CommonUnit[], fn: Function, errorTitle: string, )
| 225 | return finalEvent |
| 226 | } |
| 227 | function on<State>( |
| 228 | store: Store<State>, |
| 229 | methodName: string, |
| 230 | nodeSet: CommonUnit | CommonUnit[], |
| 231 | fn: Function, |
| 232 | errorTitle: string, |
| 233 | ) { |
| 234 | assertNodeSet(nodeSet, `${errorTitle} ${methodName}`, 'first argument') |
| 235 | assert(isFunction(fn), 'second argument should be a function', errorTitle) |
| 236 | deprecate( |
| 237 | !getMeta(store, 'derived'), |
| 238 | `${methodName} in derived store`, |
| 239 | `${methodName} in store created via createStore`, |
| 240 | errorTitle, |
| 241 | ) |
| 242 | forEach(Array.isArray(nodeSet) ? nodeSet : [nodeSet], trigger => { |
| 243 | store.off(trigger) |
| 244 | updateStore(trigger, store, 'on', callARegStack, fn) |
| 245 | }) |
| 246 | return store |
| 247 | } |
| 248 | |
| 249 | export const requireExplicitSkipVoidMessage = |
| 250 | 'undefined is used to skip updates. To allow undefined as a value provide explicit { skipVoid: false } option' |
no test coverage detected