Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandra committed Jul 19, 2021
1 parent 9f8da08 commit d91bdc5
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
readme.md
43 changes: 27 additions & 16 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
#### Folder structure

/src
index.tsx: Entry point file that renders the React component tree

- index.tsx: Entry point file that renders the React component tree

/app
store.ts: store setup
rootReducer.ts: root reducer (optional)
App.tsx: root React component
/common: hooks, generic components, utils, etc
/features: contains all "feature folders"
/todos: a single feature folder
todosSlice.ts: Redux reducer logic and associated actions
Todos.tsx: a React component
/app contains app-wide setup and layout that depends on all the other folders.

/common
contains truly generic and reusable utilities and components.

/features
has folders that contain all functionality related to a specific feature. In this example, todosSlice.ts is a "duck"-style file that contains a call to RTK's createSlice() function, and exports the slice reducer and action creators.

- store.ts: store setup
- rootReducer.ts: root reducer (optional)
- App.tsx: root React component

/common: hooks, generic components, utils, etc

/features: contains all "feature folders"

- /todos:
- a single feature folder todosSlice.ts: Redux reducer logic and associated actions
- Todos.tsx: a React component

/app

- contains app-wide setup and layout that depends on all the other folders.

/common

- contains truly generic and reusable utilities and components.

/features

- has folders that contain all functionality related to a specific feature. In this example, todosSlice.ts is a "duck"-style file that contains a call to RTK's createSlice() function, and exports the slice reducer and action creators.
5 changes: 4 additions & 1 deletion src/app/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { configureStore } from "@reduxjs/toolkit";
import rootReducer from "./rootReducer";

const store = configureStore({
reducer: rootReducer
reducer: rootReducer,
devTools: {
name: "TweetFind"
}
});

export default store;
6 changes: 3 additions & 3 deletions src/features/Finder/findTweets.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ const URI = "https://t-api.vercel.app/api/search";

export const findTweets = async (searchQuery, amount) => {
const response = await fetch(
`${URI}?query=${searchQuery}&max_results=${amount}`,{
mode:'no-cors'
`${URI}?query=${searchQuery}&max_results=${amount}`,
{
mode: "no-cors"
}
);

if (!response.ok) {
throw new Error(`Response wasn't ok!`);
}
Expand Down

1 comment on commit d91bdc5

@vercel
Copy link

@vercel vercel bot commented on d91bdc5 Jul 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.