https://github.com/anucha-tk/posts-redux-rtk
crud posts with redux rtk query advanced, react-hook-form, chakra UI
https://github.com/anucha-tk/posts-redux-rtk
Last synced: 10 months ago
JSON representation
crud posts with redux rtk query advanced, react-hook-form, chakra UI
- Host: GitHub
- URL: https://github.com/anucha-tk/posts-redux-rtk
- Owner: anucha-tk
- Created: 2022-12-13T08:47:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-05T03:09:12.000Z (over 2 years ago)
- Last Synced: 2024-12-27T01:12:24.877Z (over 1 year ago)
- Language: TypeScript
- Size: 269 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Posts React RTK Advanced
CRUD with Redux RTK Query Advanced with createEntityAdapter and InjectEndpoints
# Table of contents
- [Posts React RTK Advanced](#posts-react-rtk-advanced)
- [Table of contents](#table-of-contents)
- [How to start](#how-to-start)
- [Tech stack and Features](#tech-stack-and-features)
- [Example](#example)
- [Tacticals](#tacticals)
- [Advanced RTK createEntityAdapter](#advanced-rtk-createentityadapter)
# How to start
```bash
json-server data/db.json -p 3500 && yarn start
```
# Tech stack and Features
- Front end: [React](https://reactjs.org/)
- Css: [Chakra-ui](https://chakra-ui.com/)
- Api: [Json-server](https://github.com/typicode/json-server)
- State management & api Cache: [Redux toolkit RTK](https://redux-toolkit.js.org/)
- crud post
- store data to json
- emoji state by post
# Example

# Tacticals
## Advanced RTK createEntityAdapter
we add selectId and sortComparer for query
```typescript
// postSlice.ts
const postAdapter = createEntityAdapter({
selectId: (post) => post.id,
sortComparer: (a, b) => b.date.localeCompare(a.date),
});
```