Function
Static Public Summary | ||
public |
Generate an user log in component |
|
public |
Generate a form |
|
public |
FilterLink(props: Object): ReactDOM Generate a link to change filter value |
|
public |
Temporary home page |
|
public |
Main wrapper |
|
public |
Generate site navigation |
|
public |
Error 404 fallback page |
|
public |
Generate a clickable todo item with a label and an delete button |
|
public |
Generate the whole todo application |
|
public |
TodoFilterLinks(props: Object): ReactDOM Generate a list of todo filter links |
|
public |
TodoFooter(props: Object): ReactDOM Generate a footer for the todo list |
|
public |
Generate a form to submit a new todo |
|
public |
Generate a list of todos |
|
public |
Generate user item with a picture and a link to the profile |
|
public |
Generate a header to display list title and button to launch user query |
|
public |
Generate a visual error when request fails |
|
public |
UserHeader(props: Object): ReactDOM Generate a header to display list title and button to launch user query |
|
public |
Generate a list of users |
|
public |
action to add a todo |
|
public |
authReducer(state: Object, action: Object): Object reducer for auth actions |
|
public |
action to clear completed todos |
|
public |
fetchUsers(since: number, perPage: number): Object action to fetch user |
|
public |
fetchUsersEpic(action$: Object): Array<userObj> | Object Epic observer that query user API when triggered |
|
public |
fetchUsersError(error: *): Object action to provide users error logs to state |
|
public |
fetchUsersSuccess(data: Array<userObj>): Object action to provide users data to the state |
|
public |
filter a list of given todos |
|
public |
action to log user in |
|
public |
Epic observer that query auth API when triggered |
|
public |
logInFailure(error: Object): Object action to notify user log in failure |
|
public |
logInSuccess(user: Object): Object action to notify user log in success |
|
public |
action to log user out |
|
public |
removeTodo(id: number): Object action to remove a todo |
|
public |
setTodoFilter(filter: string): Object action to set a filter |
|
public |
todoFiltersReducer(state: string, action: string): string reducer for filter actions |
|
public |
reducer for todo actions |
|
public |
toggleTodo(id: number): Object action to toggle a todo |
|
public |
usersReducer(state: Object, action: Object): Object reducer for users actions |
Static Public
public AuthApp(props: Object): ReactDOM source
import {AuthApp} from 'redux/app/modules/auth/AuthApp.component.js'
Generate an user log in component
Test:
public AuthForm(props: Object): ReactDOM source
import {AuthForm} from 'redux/app/modules/auth/AuthApp.component.js'
Generate a form
Test:
public FilterLink(props: Object): ReactDOM source
import {FilterLink} from 'redux/app/modules/todos/TodoApp.component.js'
Generate a link to change filter value
Params:
Name | Type | Attribute | Description |
props | Object |
|
react props object |
props.active | boolean |
|
whether the link is already active or not |
props.filter | string |
|
constant representing the filter value |
props.onClick | function(filter: string) |
|
function to perform when link is clicked, here setTodoFilter |
Test:
public HomePage(): ReactDOM source
import {HomePage} from 'redux/app/modules/main/MainApp.component.js'
Temporary home page
public MainApp(props: Object): ReactDOM source
import MainApp from 'redux/app/modules/main/MainApp.component.js'
Main wrapper
public Menu(): ReactDOM source
import {Menu} from 'redux/app/modules/main/MainApp.component.js'
Generate site navigation
public NotFound(): ReactDOM source
import {NotFound} from 'redux/app/modules/main/MainApp.component.js'
Error 404 fallback page
public Todo(props: Object): ReactDOM source
import {Todo} from 'redux/app/modules/todos/TodoApp.component.js'
Generate a clickable todo item with a label and an delete button
Params:
Name | Type | Attribute | Description |
props | Object |
|
react props object |
props.completed | boolean |
|
whether the todo is completed or not |
props.label | string |
|
the todo label |
props.onClick | function |
|
the function to perform when the todo label is clicked, here toggleTodo |
props.onButtonClick | function |
|
the function to perform when the todo button is clicked, here removeTodo |
Test:
public TodoApp(props: Object): ReactDOM source
import {TodoApp} from 'redux/app/modules/todos/TodoApp.component.js'
Generate the whole todo application
Params:
Name | Type | Attribute | Description |
props | Object |
|
react props object |
props.todos | Array<todoObj> |
|
list of all available todos |
props.filter | string |
|
current active filter |
props.filterList | Array<string> |
|
list of all todo filters |
props.onTodoFormSubmit | function |
|
function to perform when the todo form is submitted |
props.onTodoClick | function |
|
function to perform when the todo label is clicked |
props.onTodoButtonClick | function |
|
function to perform when the todo button is clicked |
props.onTodoClearClick | function |
|
function to perform when the clear button is clicked |
props.onLinkClick | function |
|
function to perform when a filter link is clicked |
Test:
public TodoFilterLinks(props: Object): ReactDOM source
import {TodoFilterLinks} from 'redux/app/modules/todos/TodoApp.component.js'
Generate a list of todo filter links
Params:
Name | Type | Attribute | Description |
props | Object |
|
react props object |
props.filterList | Array<string> |
|
list of all available filters |
props.currentFilter | string |
|
constant representing the currently active filter in the list |
props.onLinkClick | function() |
|
function to perform when a filter link is clicked |
Test:
public TodoFooter(props: Object): ReactDOM source
import {TodoFooter} from 'redux/app/modules/todos/TodoApp.component.js'
Generate a footer for the todo list
Test:
public TodoForm(props: Object): ReactDOM source
import {TodoForm} from 'redux/app/modules/todos/TodoApp.component.js'
Generate a form to submit a new todo
Test:
public TodoList(props: Object): ReactDOM source
import {TodoList} from 'redux/app/modules/todos/TodoApp.component.js'
Generate a list of todos
Params:
Name | Type | Attribute | Description |
props | Object |
|
react props object |
props.filteredTodos | Array<todoObj> |
|
pre-filtered list of todos depending on the actual selected filter |
props.onTodoClick | function(id: number) |
|
function to perform when a todo label is clicked, here toggleTodo |
props.onTodoButtonClick | function(id: number) |
|
function to perform when a todo button is clicked, here removeTodo |
Test:
public User(props: userObj): ReactDOM source
import {User} from 'redux/app/modules/users/UserApp.component.js'
Generate user item with a picture and a link to the profile
Params:
Name | Type | Attribute | Description |
props | userObj |
|
user object |
Test:
public UserApp(props: Object): ReactDOM source
import {UserApp} from 'redux/app/modules/users/UserApp.component.js'
Generate a header to display list title and button to launch user query
Params:
Name | Type | Attribute | Description |
props | Object |
|
react props object |
props.users | Array<userObj> |
|
list of user object |
props.error | Object |
|
error object to display |
props.error.message | string |
|
error message |
props.onRefreshButtonClick | Object |
|
function to run when refresh button is clicked |
Test:
public UserError(props: Object): ReactDOM source
import {UserError} from 'redux/app/modules/users/UserApp.component.js'
Generate a visual error when request fails
Test:
public UserHeader(props: Object): ReactDOM source
import {UserHeader} from 'redux/app/modules/users/UserApp.component.js'
Generate a header to display list title and button to launch user query
Test:
public UserList(props: Object): ReactDOM source
import {UserList} from 'redux/app/modules/users/UserApp.component.js'
Generate a list of users
Test:
public addTodo(label: string): Object source
import {addTodo} from 'redux/app/modules/todos/reducers/todos.reducer.js'
action to add a todo
Params:
Name | Type | Attribute | Description |
label | string |
|
Return:
Object |
Test:
public authReducer(state: Object, action: Object): Object source
import authReducer from 'redux/app/modules/auth/reducers/auth.reducer.js'
reducer for auth actions
Params:
Name | Type | Attribute | Description |
state | Object | current state value |
|
state.isFetching | boolean | whether auth process is pending or not |
|
state.isAuthenticated | boolean | whether user is authenticated or not |
|
state.user | Object | user data |
|
state.error | Object | error data |
|
action | Object | action to perform on the state |
|
action.type | string | describe the action type |
Return:
Object |
Test:
public clearTodo(): Object source
import {clearTodo} from 'redux/app/modules/todos/reducers/todos.reducer.js'
action to clear completed todos
Test:
public fetchUsers(since: number, perPage: number): Object source
import {fetchUsers} from 'redux/app/modules/users/reducers/users.reducer.js'
action to fetch user
Return:
Object |
Test:
public fetchUsersEpic(action$: Object): Array<userObj> | Object source
import {fetchUsersEpic} from 'redux/app/modules/users/reducers/users.reducer.js'
Epic observer that query user API when triggered
public fetchUsersError(error: *): Object source
import {fetchUsersError} from 'redux/app/modules/users/reducers/users.reducer.js'
action to provide users error logs to state
Params:
Name | Type | Attribute | Description |
error | * | error from failed API request |
public fetchUsersSuccess(data: Array<userObj>): Object source
import {fetchUsersSuccess} from 'redux/app/modules/users/reducers/users.reducer.js'
action to provide users data to the state
Return:
Object |
public getFilteredTodos(todos: Array<todoObj>, filter: string): Array<todoObj> source
import {getFilteredTodos} from 'redux/app/modules/todos/reducers/todoFilter.reducer.js'
filter a list of given todos
public logIn(login: string, password: string): Object source
import {logIn} from 'redux/app/modules/auth/reducers/auth.reducer.js'
action to log user in
Return:
Object |
Test:
public logInEpic(action$: Object): Object source
import {logInEpic} from 'redux/app/modules/auth/reducers/auth.reducer.js'
Epic observer that query auth API when triggered
public logInFailure(error: Object): Object source
import {logInFailure} from 'redux/app/modules/auth/reducers/auth.reducer.js'
action to notify user log in failure
Params:
Name | Type | Attribute | Description |
error | Object |
|
error object related to the failure |
Return:
Object |
Test:
public logInSuccess(user: Object): Object source
import {logInSuccess} from 'redux/app/modules/auth/reducers/auth.reducer.js'
action to notify user log in success
Params:
Name | Type | Attribute | Description |
user | Object |
|
data to associate to the current user |
Return:
Object |
Test:
public logOut(): Object source
import {logOut} from 'redux/app/modules/auth/reducers/auth.reducer.js'
action to log user out
Test:
public removeTodo(id: number): Object source
import {removeTodo} from 'redux/app/modules/todos/reducers/todos.reducer.js'
action to remove a todo
Params:
Name | Type | Attribute | Description |
id | number |
|
Return:
Object |
Test:
public setTodoFilter(filter: string): Object source
import {setTodoFilter} from 'redux/app/modules/todos/reducers/todoFilter.reducer.js'
action to set a filter
Params:
Name | Type | Attribute | Description |
filter | string | label of the filter to set |
Return:
Object |
Test:
public todoFiltersReducer(state: string, action: string): string source
import todoFiltersReducer from 'redux/app/modules/todos/reducers/todoFilter.reducer.js'
reducer for filter actions
public todosReducer(state: Array<todoObj>, action: Object): Array<todoObj> source
import todosReducer from 'redux/app/modules/todos/reducers/todos.reducer.js'
reducer for todo actions
Test:
public toggleTodo(id: number): Object source
import {toggleTodo} from 'redux/app/modules/todos/reducers/todos.reducer.js'
action to toggle a todo
Params:
Name | Type | Attribute | Description |
id | number |
|
Return:
Object |
Test:
public usersReducer(state: Object, action: Object): Object source
import usersReducer from 'redux/app/modules/users/reducers/users.reducer.js'
reducer for users actions
Params:
Name | Type | Attribute | Description |
state | Object | current state value |
|
state.requestState | string | user request state |
|
state.data | Array<userObj> | data gotten from user request |
|
state.error | Object |
|
error object from failed user request |
state.error.message | string | error object if an error occurred |
|
action | Object | action to perform on the state |
|
action.type | string | describe the action type |
Return:
Object |