fix some spelling issues

This commit is contained in:
2021-03-14 06:39:22 +00:00
parent bd9758701a
commit 1184c2218b
7 changed files with 36 additions and 32 deletions

View File

@@ -4,5 +4,12 @@
"**/package-lock.json": true
},
"editor.insertSpaces": true,
"editor.tabSize": 4
"editor.tabSize": 4,
"cSpell.words": [
"Objs",
"precache",
"precaching",
"renderprops",
"todos"
]
}

View File

@@ -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";

View File

@@ -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));
};
}

View File

@@ -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 });
};
}

View File

@@ -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(
<Provider store={store}>
<AppContainer />
</Provider>,
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(
<Provider store={store}>
<AppContainer />
</Provider>,
document.getElementById("root"),
);
}
}),
applyMiddleware(thunk, keepSynced),
),
);

View File

@@ -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) {

View File

@@ -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,