/
githubmirror
/
react-beautiful-dnd
Обзор
Документация
Войти
/
githubmirror
/
react-beautiful-dnd
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/debug/middleware/log.js
26 строк
639 B
Alex Reardon
initial bumping
17 апр 2020, 10:14
17 апр 2020, 10:14
9186352
Код
Авторство
О чём код?
// @flow /* eslint-disable no-console */ import type { Action, Store } from '../../state/store-types'; type Mode = 'verbose' | 'light'; export default (mode?: Mode = 'verbose') => (store: Store) => ( next: (Action) => mixed, ) => (action: Action): any => { if (mode === 'light') { console.log('🏃 Action:', action.type); return next(action); } console.group(`action: ${action.type}`); console.log('action payload', action.payload); console.log('state before', store.getState()); const result: mixed = next(action); console.log('state after', store.getState()); console.groupEnd(); return result; };