From 1184c2218bd345cd3bab0323e76e58abb3b6334e Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Sun, 14 Mar 2021 06:39:22 +0000 Subject: [PATCH] fix some spelling issues --- .vscode/settings.json | 9 ++++++++- client/src/actions/defs.js | 4 ++-- client/src/actions/lists.js | 12 ++++++------ client/src/actions/todos.js | 4 ++-- client/src/index.js | 31 ++++++++++++++----------------- client/src/reducers/lists.js | 4 ++-- client/src/reducers/todos.js | 4 ++-- 7 files changed, 36 insertions(+), 32 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index fd0f504..fa6ab1c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,12 @@ "**/package-lock.json": true }, "editor.insertSpaces": true, - "editor.tabSize": 4 + "editor.tabSize": 4, + "cSpell.words": [ + "Objs", + "precache", + "precaching", + "renderprops", + "todos" + ] } diff --git a/client/src/actions/defs.js b/client/src/actions/defs.js index 575ed14..a99fe16 100644 --- a/client/src/actions/defs.js +++ b/client/src/actions/defs.js @@ -1,7 +1,7 @@ export const ADD_LIST = "ADD_LIST"; export const REMOVE_LIST = "REMOVE_LIST"; export const EDIT_LIST_NAME = "EDIT_LIST_NAME"; -export const RECIEVE_LISTS = "RECIEVE_LISTS"; +export const RECEIVE_LISTS = "RECEIVE_LISTS"; export const REQUEST_LISTS = "REQUEST_LISTS"; export const INVALIDATE_LISTS = "INVALIDATE_LISTS"; export const VALIDATE_LISTS = "VALIDATE_LISTS"; @@ -16,7 +16,7 @@ export const REMOVE_TODO = "REMOVE_TODO"; export const TOGGLE_TODO = "TOGGLE_TODO"; export const EDIT_TODO = "EDIT_TODO"; export const SET_VISIBILITY_FILTER = "SET_VISIBILITY_FILTER"; -export const RECIEVE_TODOS = "RECIEVE_TODOS"; +export const RECEIVE_TODOS = "RECEIVE_TODOS"; export const REQUEST_TODOS = "REQUEST_TODOS"; export const INVALIDATE_TODOS = "INVALIDATE_TODOS"; export const VALIDATE_TODOS = "VALIDATE_TODOS"; diff --git a/client/src/actions/lists.js b/client/src/actions/lists.js index 70f0729..f40086d 100644 --- a/client/src/actions/lists.js +++ b/client/src/actions/lists.js @@ -1,6 +1,6 @@ import { REQUEST_LISTS, - RECIEVE_LISTS, + RECEIVE_LISTS, CHANGE_LIST, START_CREATE_LIST, START_EDIT_LIST, @@ -10,7 +10,7 @@ import { INVALIDATE_LISTS, REMOVE_LIST, EDIT_LIST_NAME, - RECIEVE_TODOS, + RECEIVE_TODOS, } from "./defs"; import { API_ROOT, getToken, mongoObjectId } from "./util"; @@ -18,8 +18,8 @@ import { API_ROOT, getToken, mongoObjectId } from "./util"; function requestLists() { return { type: REQUEST_LISTS }; } -function recieveLists(lists) { - return { type: RECIEVE_LISTS, lists }; +function receiveLists(lists) { + return { type: RECEIVE_LISTS, lists }; } export function changeList(list) { return { type: CHANGE_LIST, list }; @@ -156,7 +156,7 @@ export function fetchLists() { return newObj; }, {}); - dispatch({ type: RECIEVE_TODOS, todos: normalizeTodos(lists) }); - dispatch(recieveLists(listsObj)); + dispatch({ type: RECEIVE_TODOS, todos: normalizeTodos(lists) }); + dispatch(receiveLists(listsObj)); }; } diff --git a/client/src/actions/todos.js b/client/src/actions/todos.js index 1e2d77e..622a3f3 100644 --- a/client/src/actions/todos.js +++ b/client/src/actions/todos.js @@ -1,6 +1,6 @@ import { REQUEST_TODOS, - RECIEVE_TODOS, + RECEIVE_TODOS, ADD_TODO, REMOVE_TODO, TOGGLE_TODO, @@ -20,7 +20,7 @@ export function fetchTodos() { }); const json = await response.json(); const todos = json.data; - dispatch({ type: RECIEVE_TODOS, todos }); + dispatch({ type: RECEIVE_TODOS, todos }); }; } diff --git a/client/src/index.js b/client/src/index.js index f960235..38bb053 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -12,25 +12,22 @@ import todoApp from "./reducers"; import { setToken } from "./actions/util"; import keepSynced from "./middleware/keepSynced"; -let store; - -const persistCallback = () => { - const state = store.getState(); - if (state.user.user) { - setToken(state.user.user.jwt); - } - ReactDOM.render( - - - , - document.getElementById("root"), - ); -}; - -store = createStore( +const store = createStore( todoApp, compose( - offline({ ...offlineConfig, persistCallback }), + offline({ ...offlineConfig, persistCallback: () => { + const state = store.getState(); + if (state.user.user) { + setToken(state.user.user.jwt); + } + ReactDOM.render( + + + , + document.getElementById("root"), + ); + } + }), applyMiddleware(thunk, keepSynced), ), ); diff --git a/client/src/reducers/lists.js b/client/src/reducers/lists.js index 2076d9d..672b6c9 100644 --- a/client/src/reducers/lists.js +++ b/client/src/reducers/lists.js @@ -3,7 +3,7 @@ import { INVALIDATE_LISTS, VALIDATE_LISTS, REQUEST_LISTS, - RECIEVE_LISTS, + RECEIVE_LISTS, ADD_LIST, REMOVE_LIST, EDIT_LIST_NAME, @@ -41,7 +41,7 @@ export default function lists( }; case CHANGE_LIST: return { ...state, list: action.list }; - case RECIEVE_LISTS: { + case RECEIVE_LISTS: { const newLists = Object.values(action.lists); let { list } = state; if (newLists.length !== 0) { diff --git a/client/src/reducers/todos.js b/client/src/reducers/todos.js index ff0051d..6c6c9e2 100644 --- a/client/src/reducers/todos.js +++ b/client/src/reducers/todos.js @@ -2,7 +2,7 @@ import { ADD_TODO, REMOVE_TODO, TOGGLE_TODO, - RECIEVE_TODOS, + RECEIVE_TODOS, REQUEST_TODOS, INVALIDATE_TODOS, VALIDATE_TODOS, @@ -26,7 +26,7 @@ export default function todos( fetching: false, todos: null, }; - case RECIEVE_TODOS: + case RECEIVE_TODOS: return { ...state, dirty: false,