-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #245 from Digital-Engineering/development
Development
- Loading branch information
Showing
47 changed files
with
11,064 additions
and
1,362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'; | ||
import type { RootState, AppDispatch } from '../store'; | ||
|
||
// Use throughout your app instead of plain `useDispatch` and `useSelector` | ||
export const useAppDispatch: () => AppDispatch = useDispatch; | ||
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { useState, useCallback } from 'react'; | ||
import { useDispatch } from 'react-redux'; | ||
|
||
export function useThunk(thunk: any) { | ||
const [isLoading, setIsLoading] = useState(false); | ||
const [error, setError] = useState(null); | ||
const dispatch = useDispatch(); | ||
|
||
const runThunk = useCallback( | ||
(arg: any) => { | ||
setIsLoading(true); | ||
dispatch(thunk(arg)) | ||
.unwrap() | ||
.catch((err: any) => setError(err)) | ||
.finally(() => setIsLoading(false)); | ||
}, | ||
[dispatch, thunk] | ||
); | ||
|
||
return [runThunk, isLoading, error]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { createSlice } from '@reduxjs/toolkit'; | ||
import { fetchWebGL } from '../thunks/fetchWebGL'; | ||
|
||
const webGLSlice = createSlice({ | ||
name: 'webGL', | ||
initialState: { | ||
isLoading: false, | ||
data: [], | ||
error: null, | ||
}, | ||
extraReducers(builder) { | ||
builder.addCase(fetchWebGL.pending, (state, action) => { | ||
state.isLoading = true; | ||
}); | ||
builder.addCase(fetchWebGL.fulfilled, (state, action) => { | ||
state.isLoading = false; | ||
state.data = action.payload; | ||
}); | ||
builder.addCase(fetchWebGL.rejected, (state, action) => { | ||
state.isLoading = false; | ||
state.error = action.error; | ||
}); | ||
}, | ||
}); | ||
|
||
export const webGLReducer = webGLSlice.reducer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { createAsyncThunk } from '@reduxjs/toolkit'; | ||
import axios from 'axios'; | ||
|
||
const fetchWebGL = createAsyncThunk('webgl/fetch', async () => { | ||
|
||
}); | ||
|
||
export { fetchWebGL }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,11 @@ | |
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/assets/data-gray.png" /> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" /> | ||
<link rel="icon" type="image/svg+xml" href="viewer/assets/data-gray.png" /> | ||
<link | ||
rel="stylesheet" | ||
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" | ||
/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Deep Lynx WebGL Viewer</title> | ||
</head> | ||
|
Oops, something went wrong.