mirror of
https://github.com/Mastermindzh/react-starter-kit.git
synced 2025-08-23 17:44:52 +02:00
Moved examples into example directory
Moved routes to separate file Used route constants
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
// A mock function to mimic making an async request for data
|
||||
export function fetchCount(amount = 1) {
|
||||
return new Promise<{ data: number }>((resolve) => setTimeout(() => resolve({ data: amount }), 500));
|
||||
}
|
@@ -18,7 +18,7 @@
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-top: 2px;
|
||||
font-family: 'Courier New', Courier, monospace;
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
|
||||
.button {
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
|
||||
.asyncButton:after {
|
||||
content: '';
|
||||
content: "";
|
||||
background-color: rgba(112, 76, 182, 0.15);
|
||||
display: block;
|
||||
position: absolute;
|
@@ -1,7 +1,7 @@
|
||||
import { useState } from "react";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAppDispatch, useAppSelector } from "../../app/hooks";
|
||||
import { useAppDispatch, useAppSelector } from "../../../app/hooks";
|
||||
import styles from "./Counter.module.css";
|
||||
import { incrementAsync } from "./state/actions/incrementAsync";
|
||||
import {
|
6
src/features/examples/counter/services/counterAPI.ts
Normal file
6
src/features/examples/counter/services/counterAPI.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// A mock function to mimic making an async request for data
|
||||
export function fetchCount(amount = 1) {
|
||||
return new Promise<{ data: number }>((resolve) =>
|
||||
setTimeout(() => resolve({ data: amount }), 500),
|
||||
);
|
||||
}
|
@@ -1,8 +1,4 @@
|
||||
import counterReducer, {
|
||||
increment,
|
||||
decrement,
|
||||
incrementByAmount,
|
||||
} from "./counterSlice";
|
||||
import counterReducer, { increment, decrement, incrementByAmount } from "./counterSlice";
|
||||
import { CounterState } from "../models/CounterState";
|
||||
|
||||
describe("counter reducer", () => {
|
@@ -1,5 +1,5 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { AppThunk, RootState } from "../../../app/store";
|
||||
import { AppThunk, RootState } from "../../../../app/store";
|
||||
import { CounterState } from "../models/CounterState";
|
||||
import { incrementAsync } from "./actions/incrementAsync";
|
||||
|
@@ -8,19 +8,39 @@ export const HomeContainer: FunctionComponent<Props> = () => {
|
||||
<p>This is the react base app :)</p>
|
||||
<span>
|
||||
<span>Learn </span>
|
||||
<a className="App-link" href="https://reactjs.org/" target="_blank" rel="noopener noreferrer">
|
||||
<a
|
||||
className="App-link"
|
||||
href="https://reactjs.org/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
React
|
||||
</a>
|
||||
<span>, </span>
|
||||
<a className="App-link" href="https://redux.js.org/" target="_blank" rel="noopener noreferrer">
|
||||
<a
|
||||
className="App-link"
|
||||
href="https://redux.js.org/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Redux
|
||||
</a>
|
||||
<span>, </span>
|
||||
<a className="App-link" href="https://redux-toolkit.js.org/" target="_blank" rel="noopener noreferrer">
|
||||
<a
|
||||
className="App-link"
|
||||
href="https://redux-toolkit.js.org/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Redux Toolkit
|
||||
</a>
|
||||
,<span> and </span>
|
||||
<a className="App-link" href="https://react-redux.js.org/" target="_blank" rel="noopener noreferrer">
|
||||
<a
|
||||
className="App-link"
|
||||
href="https://react-redux.js.org/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
React Redux
|
||||
</a>
|
||||
</span>
|
||||
|
Reference in New Issue
Block a user