Skip to content

Commit

Permalink
refactor: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Jun 19, 2021
1 parent 6cb59be commit aae0ab0
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 114 deletions.
138 changes: 69 additions & 69 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "21:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: stylelint-config-standard
versions:
- 22.0.0
- dependency-name: core-js
versions:
- 3.10.2
- dependency-name: "@types/helmet"
versions:
- 4.0.0
- dependency-name: "@types/react-dom"
versions:
- 17.0.0
- 17.0.1
- 17.0.2
- 17.0.3
- dependency-name: eslint-config-prettier
versions:
- 7.2.0
- 8.0.0
- 8.1.0
- 8.2.0
- dependency-name: "@types/react"
versions:
- 17.0.0
- 17.0.1
- 17.0.2
- 17.0.3
- dependency-name: "@types/react-test-renderer"
versions:
- 17.0.0
- 17.0.1
- dependency-name: "@types/serialize-javascript"
versions:
- 5.0.0
- dependency-name: webpack-bundle-analyzer
versions:
- 4.4.0
- 4.4.1
- dependency-name: fork-ts-checker-webpack-plugin
versions:
- 6.1.0
- 6.1.1
- 6.2.0
- 6.2.1
- dependency-name: mini-css-extract-plugin
versions:
- 1.3.5
- 1.3.6
- 1.3.7
- 1.3.8
- 1.3.9
- 1.4.0
- 1.4.1
- dependency-name: webpack-dev-middleware
versions:
- 4.1.0
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "21:00"
open-pull-requests-limit: 10
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "21:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: stylelint-config-standard
versions:
- 22.0.0
- dependency-name: core-js
versions:
- 3.10.2
- dependency-name: "@types/helmet"
versions:
- 4.0.0
- dependency-name: "@types/react-dom"
versions:
- 17.0.0
- 17.0.1
- 17.0.2
- 17.0.3
- dependency-name: eslint-config-prettier
versions:
- 7.2.0
- 8.0.0
- 8.1.0
- 8.2.0
- dependency-name: "@types/react"
versions:
- 17.0.0
- 17.0.1
- 17.0.2
- 17.0.3
- dependency-name: "@types/react-test-renderer"
versions:
- 17.0.0
- 17.0.1
- dependency-name: "@types/serialize-javascript"
versions:
- 5.0.0
- dependency-name: webpack-bundle-analyzer
versions:
- 4.4.0
- 4.4.1
- dependency-name: fork-ts-checker-webpack-plugin
versions:
- 6.1.0
- 6.1.1
- 6.2.0
- 6.2.1
- dependency-name: mini-css-extract-plugin
versions:
- 1.3.5
- 1.3.6
- 1.3.7
- 1.3.8
- 1.3.9
- 1.4.0
- 1.4.1
- dependency-name: webpack-dev-middleware
versions:
- 4.1.0
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "21:00"
open-pull-requests-limit: 10
58 changes: 29 additions & 29 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '27 0 * * 0'
- cron: "27 0 * * 0"

jobs:
analyze:
Expand All @@ -32,40 +32,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Checkout repository
uses: actions/[email protected]

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
33 changes: 17 additions & 16 deletions src/store/userData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,27 @@ const userData = createSlice({
export default userData.reducer;
export const { getRequesting, getSuccess, getFailure } = userData.actions;

export const fetchUserData = (id: string): AppThunk => async (dispatch) => {
dispatch(getRequesting(id));
export const fetchUserData =
(id: string): AppThunk =>
async (dispatch) => {
dispatch(getRequesting(id));

const { error, data } = await getUserData(id);
const { error, data } = await getUserData(id);

if (error) {
dispatch(getFailure({ id, error: error.message }));
} else {
dispatch(getSuccess({ id, item: data as User }));
}
};
if (error) {
dispatch(getFailure({ id, error: error.message }));
} else {
dispatch(getSuccess({ id, item: data as User }));
}
};

const shouldFetchUserData = (state: AppState, id: string) =>
state.userData[id]?.readyStatus !== "success";

export const fetchUserDataIfNeed = (id: string): AppThunk => (
dispatch,
getState
) => {
if (shouldFetchUserData(getState(), id)) return dispatch(fetchUserData(id));
export const fetchUserDataIfNeed =
(id: string): AppThunk =>
(dispatch, getState) => {
if (shouldFetchUserData(getState(), id)) return dispatch(fetchUserData(id));

return null;
};
return null;
};

0 comments on commit aae0ab0

Please sign in to comment.