(
namespace: string,
infos: { actionName: string; params: string; state?: any },
)
| 43 | } |
| 44 | |
| 45 | export function logStateAction( |
| 46 | namespace: string, |
| 47 | infos: { actionName: string; params: string; state?: any }, |
| 48 | ): void { |
| 49 | if (isEnableLog) { |
| 50 | const action = { |
| 51 | type: `${namespace}/${infos.actionName}`, |
| 52 | params: filterParams(infos.params), |
| 53 | } |
| 54 | |
| 55 | if (infos.state) { |
| 56 | STATE[namespace] = infos.state |
| 57 | } |
| 58 | |
| 59 | getDevTools().send(action, STATE) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | function filterParams(params: any): any { |
| 64 | if (params && typeof params === 'object') { |
no test coverage detected