├── .babelrc ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .npmignore ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── README.md ├── examples └── todomvc │ ├── .babelrc │ ├── README.md │ ├── actions │ └── TodoActions.js │ ├── components │ ├── Footer.js │ ├── Header.js │ ├── MainSection.js │ ├── TodoItem.js │ └── TodoTextInput.js │ ├── constants │ ├── ActionTypes.js │ └── TodoFilters.js │ ├── containers │ ├── DevTools.js │ ├── Root.dev.js │ ├── Root.js │ ├── Root.prod.js │ └── TodoApp.js │ ├── dist │ └── index.html │ ├── index.js │ ├── package.json │ ├── reducers │ ├── index.js │ └── todos.js │ ├── store │ ├── configureStore.dev.js │ ├── configureStore.js │ └── configureStore.prod.js │ ├── webpack.config.js │ ├── webpack.config.prod.js │ └── yarn.lock ├── package.json ├── src ├── SliderButton.js ├── SliderMonitor.js └── reducers.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-0", "react"] 3 | } 4 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | lib 2 | **/node_modules 3 | examples/**/dist 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint-config-airbnb", 3 | "env": { 4 | "browser": true, 5 | "mocha": true, 6 | "node": true 7 | }, 8 | "parser": "babel-eslint", 9 | "rules": { 10 | "comma-dangle": [2, "never"], 11 | "jsx-quotes": [2, "prefer-single"], 12 | "react/jsx-uses-react": 2, 13 | "react/jsx-uses-vars": 2, 14 | "react/react-in-jsx-scope": 2, 15 | "react/sort-comp": 0, 16 | "react/forbid-prop-types": 0, 17 | "import/no-extraneous-dependencies": 0, 18 | "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], 19 | 'jsx-a11y/no-static-element-interactions': 0 20 | }, 21 | "plugins": [ 22 | "react" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | .DS_Store 4 | lib 5 | coverage 6 | bundle.js 7 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.log 3 | src 4 | test 5 | examples 6 | coverage 7 | yarn.lock 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 4 | 5 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion. 6 | 7 | Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. 8 | 9 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team. 10 | 11 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. 12 | 13 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/) 14 | 15 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Cale Newman 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Redux Slider Monitor 2 | 3 | [![npm version](https://img.shields.io/npm/v/redux-slider-monitor.svg?style=flat-square)](https://www.npmjs.com/package/redux-slider-monitor) 4 | 5 | > This package was merged into [`redux-devtools` monorepo](https://github.com/reduxjs/redux-devtools). Please refer to that repository for the latest updates, issues and pull requests. 6 | 7 | A custom monitor for use with [Redux DevTools](https://github.com/gaearon/redux-devtools). 8 | 9 | It uses a slider based on [react-slider](https://github.com/mpowaga/react-slider) to slide between different recorded actions. It also features play/pause/step-through, which is inspired by some very cool [Elm](http://elm-lang.org/) [examples](http://elm-lang.org/blog/time-travel-made-easy). 10 | 11 | [Try out the demo!](https://calesce.github.io/redux-slider-monitor/?debug_session=123) 12 | 13 | 14 | 15 | ### Installation 16 | 17 | ```npm install redux-slider-monitor``` 18 | 19 | ### Recommended Usage 20 | 21 | Use with [`DockMonitor`](https://github.com/gaearon/redux-devtools-dock-monitor) 22 | ```javascript 23 | 27 | 28 | 29 | ``` 30 | 31 | Dispatch some Redux actions. Use the slider to navigate between the state changes. 32 | 33 | Click the play/pause buttons to watch the state changes over time, or step backward or forward in state time with the left/right arrow buttons. Change replay speeds with the ```1x``` button, and "Live" will replay actions with the same time intervals in which they originally were dispatched. 34 | 35 | ## Keyboard shortcuts 36 | 37 | Pass the ```keyboardEnabled``` prop to use these shortcuts 38 | 39 | ```ctrl+j```: play/pause 40 | 41 | ```ctrl+[```: step backward 42 | 43 | ```ctrl+]```: step forward 44 | 45 | 46 | ### Running Examples 47 | 48 | You can do this: 49 | 50 | ``` 51 | git clone https://github.com/calesce/redux-slider-monitor.git 52 | cd redux-slider-monitor 53 | npm install 54 | 55 | cd examples/todomvc 56 | npm install 57 | npm start 58 | open http://localhost:3000 59 | ``` 60 | 61 | ### License 62 | 63 | MIT 64 | -------------------------------------------------------------------------------- /examples/todomvc/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["es2015", { "modules": false }], 4 | "stage-0", 5 | "react" 6 | ], 7 | "plugins": [ 8 | "react-hot-loader/babel" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /examples/todomvc/README.md: -------------------------------------------------------------------------------- 1 | # Redux DevTools TodoMVC example 2 | 3 | ## Getting Started 4 | 5 | 1. Install dependencies: `npm i` 6 | 2. Start the development server: `npm start` 7 | -------------------------------------------------------------------------------- /examples/todomvc/actions/TodoActions.js: -------------------------------------------------------------------------------- 1 | import * as types from '../constants/ActionTypes'; 2 | 3 | export function addTodo(text) { 4 | return { 5 | type: types.ADD_TODO, 6 | text 7 | }; 8 | } 9 | 10 | export function deleteTodo(id) { 11 | return { 12 | type: types.DELETE_TODO, 13 | id 14 | }; 15 | } 16 | 17 | export function editTodo(id, text) { 18 | return { 19 | type: types.EDIT_TODO, 20 | id, 21 | text 22 | }; 23 | } 24 | 25 | export function markTodo(id) { 26 | return { 27 | type: types.MARK_TODO, 28 | id 29 | }; 30 | } 31 | 32 | export function markAll() { 33 | return { 34 | type: types.MARK_ALL 35 | }; 36 | } 37 | 38 | export function clearMarked() { 39 | return { 40 | type: types.CLEAR_MARKED 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /examples/todomvc/components/Footer.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import classnames from 'classnames'; 4 | import { SHOW_ALL, SHOW_MARKED, SHOW_UNMARKED } from '../constants/TodoFilters'; 5 | 6 | const FILTER_TITLES = { 7 | [SHOW_ALL]: 'All', 8 | [SHOW_UNMARKED]: 'Active', 9 | [SHOW_MARKED]: 'Completed' 10 | }; 11 | 12 | export default class Footer extends Component { 13 | static propTypes = { 14 | markedCount: PropTypes.number.isRequired, 15 | unmarkedCount: PropTypes.number.isRequired, 16 | filter: PropTypes.string.isRequired, 17 | onClearMarked: PropTypes.func.isRequired, 18 | onShow: PropTypes.func.isRequired 19 | } 20 | 21 | render() { 22 | return ( 23 | 34 | ); 35 | } 36 | 37 | renderTodoCount() { 38 | const { unmarkedCount } = this.props; 39 | const itemWord = unmarkedCount === 1 ? 'item' : 'items'; 40 | 41 | return ( 42 | 43 | {unmarkedCount || 'No'} {itemWord} left 44 | 45 | ); 46 | } 47 | 48 | renderFilterLink(filter) { 49 | const title = FILTER_TITLES[filter]; 50 | const { filter: selectedFilter, onShow } = this.props; 51 | 52 | return ( 53 | onShow(filter)} 57 | > 58 | {title} 59 | 60 | ); 61 | } 62 | 63 | renderClearButton() { 64 | const { markedCount, onClearMarked } = this.props; 65 | if (markedCount > 0) { 66 | return ( 67 | 73 | ); 74 | } 75 | return null; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /examples/todomvc/components/Header.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import TodoTextInput from './TodoTextInput'; 4 | 5 | export default class Header extends Component { 6 | static propTypes = { 7 | addTodo: PropTypes.func.isRequired 8 | }; 9 | 10 | handleSave = (text) => { 11 | if (text.length !== 0) { 12 | this.props.addTodo(text); 13 | } 14 | } 15 | 16 | render() { 17 | return ( 18 |
19 |

todos

20 | 25 |
26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/todomvc/components/MainSection.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import TodoItem from './TodoItem'; 4 | import Footer from './Footer'; 5 | import { SHOW_ALL, SHOW_MARKED, SHOW_UNMARKED } from '../constants/TodoFilters'; 6 | 7 | const TODO_FILTERS = { 8 | [SHOW_ALL]: () => true, 9 | [SHOW_UNMARKED]: todo => !todo.marked, 10 | [SHOW_MARKED]: todo => todo.marked 11 | }; 12 | 13 | export default class MainSection extends Component { 14 | static propTypes = { 15 | todos: PropTypes.array.isRequired, 16 | actions: PropTypes.object.isRequired 17 | }; 18 | 19 | constructor(props, context) { 20 | super(props, context); 21 | this.handleClearMarked = this.handleClearMarked.bind(this); 22 | this.handleShow = this.handleShow.bind(this); 23 | this.state = { filter: SHOW_ALL }; 24 | } 25 | 26 | handleClearMarked() { 27 | const atLeastOneMarked = this.props.todos.some(todo => todo.marked); 28 | if (atLeastOneMarked) { 29 | this.props.actions.clearMarked(); 30 | } 31 | } 32 | 33 | handleShow(filter) { 34 | this.setState({ filter }); 35 | } 36 | 37 | render() { 38 | const { todos, actions } = this.props; 39 | const { filter } = this.state; 40 | 41 | const filteredTodos = todos.filter(TODO_FILTERS[filter]); 42 | const markedCount = todos.reduce((count, todo) => 43 | (todo.marked ? count + 1 : count), 44 | 0 45 | ); 46 | 47 | return ( 48 |
49 | {this.renderToggleAll(markedCount)} 50 | 55 | {this.renderFooter(markedCount)} 56 |
57 | ); 58 | } 59 | 60 | renderToggleAll(markedCount) { 61 | const { todos, actions } = this.props; 62 | if (todos.length > 0) { 63 | return ( 64 | 70 | ); 71 | } 72 | return null; 73 | } 74 | 75 | renderFooter(markedCount) { 76 | const { todos } = this.props; 77 | const { filter } = this.state; 78 | const unmarkedCount = todos.length - markedCount; 79 | 80 | if (todos.length) { 81 | return ( 82 |