mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-14 05:14:28 -08:00
redux example rename
This commit is contained in:
28
docs/examples/todos-redux/src/actions/index.js
Normal file
28
docs/examples/todos-redux/src/actions/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const nextTodoId = new Function(`
|
||||
let nextId = 0
|
||||
return function() {
|
||||
return nextId++
|
||||
}
|
||||
`)()
|
||||
|
||||
export const addTodo = text => ({
|
||||
type: 'ADD_TODO',
|
||||
id: nextTodoId(),
|
||||
text
|
||||
})
|
||||
|
||||
export const setVisibilityFilter = filter => ({
|
||||
type: 'SET_VISIBILITY_FILTER',
|
||||
filter
|
||||
})
|
||||
|
||||
export const toggleTodo = id => ({
|
||||
type: 'TOGGLE_TODO',
|
||||
id
|
||||
})
|
||||
|
||||
export const VisibilityFilters = {
|
||||
SHOW_ALL: 'SHOW_ALL',
|
||||
SHOW_COMPLETED: 'SHOW_COMPLETED',
|
||||
SHOW_ACTIVE: 'SHOW_ACTIVE'
|
||||
}
|
||||
Reference in New Issue
Block a user