(0, _immutable.Range)(1, totalOfPages + 1).filter(function (item) { return item <= 3 && page < 3 || item <= page + 1 && item >= page - 1 || item > totalOfPages - 3; }).map(function (item) { return _react2.default.createElement( PaginationButton, { active: item == page, disabled: item == page, key: 'page.' + item, onClick: _this7.goToPage(item) }, item ); }).toJS()
createSelector( getVisibleTodos, todos => { return todos.filter(todo => !todo.get('completed')); }, )
const TodoLists = (props: Props) => { const { onRemove, onMove, todos } = props; return ( <div className={styles.root}> {Range(0, 3).map(category => ( <TodoList key={category} category={categoryNames[category]} onRemove={onRemove} onMove={onMove} todos={todos.filter(todo => todo.category === category).sortBy(todo => todo.text)} /> ))} </div> ); }
/* * Bind all the functions from the `actions` and bind them with * `dispatch` */ export default function mapDispatchToProps(actions){ return function (dispatch) { let res = {}; for (let action in actions) { res[action] = bindActionCreators(Map().merge(actions[action]).filter(value => typeof value === 'function').toObject(), dispatch); } return { actions: res, dispatch }; } }
}).filter(f => f); default: return state;
createSelector( [getTodos, getFilter], (todos, filter) => { let res; switch (filter) { case TODO_FILTER_TYPES.SHOW_ACTIVE: res = todos.filter(todo => !todo.get('completed')); break; case TODO_FILTER_TYPES.SHOW_COMPLETED: res = todos.filter(todo => todo.get('completed')); break; default: res = todos; } return res; }, )
todoList = todoList.filter(function(todo) { return !todo.complete; });
.filter(item => { return ((item <= 3 && page < 3) || (item <= page + 1 && item >= page - 1)) || (item > (totalOfPages - 3)) }).map((item) => {
.filter(item => { return ((item <= 3 && page < 3) || (item <= page + 1 && item >= page - 1)) || (item > (totalOfPages - 3)) }).map((item) => {
createSelector(getTodos, todos => { return todos.filter(todo => todo.get('completed')); })
(0, _immutable.Range)(1, totalOfPages + 1).filter(function (item) { return item <= 3 && page < 3 || item <= page + 1 && item >= page - 1 || item > totalOfPages - 3; }).map(function (item) { return _react2.default.createElement( PaginationButton, { active: item == page, disabled: item == page, key: 'page.' + item, onClick: _this7.goToPage(item) }, item ); }).toJS()