6

GitHub - garronej/clean-redux: 📐 Clean Architecture with Redux

 2 years ago
source link: https://github.com/garronej/clean-redux
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

triangular_ruler Toolkit for implementing clean architecture using Redux triangular_ruler
nut_and_bolt Focuses on achieving great type inference nut_and_bolt
dart Easy to navigate, easy to maintain dart

This repo aims to be a guide on how to implement Clean Architecture using @reduxjs/toolkit.
The NPM library clean-redux is a set of utils that you will need to achieve perfect type inference.

Benefits

Implementing the approach exposed here enables large-scale app to remain maintainable for years even in the context of frequent developer turnover. The provided utilities internally leverage TypeScript's template literal types witch makes the developer experience truly next level.

clean-redux_with_react.mov

Note that there is no need to explicitly call dispatch and the result of the selector are automatically wrapped into object so they can be destructured with the correct name. Note also that in the examples we use React but clean-redux is UI framework agnostic.

Install / Import

$ yarn add @reduxjs/toolkit clean-redux

Documentation

Canonical Clean Architecture setup: src/test/demo-app.

To understand what the functions exposed by clean-redux do in detail, please refer to the compile time unit tests they worth more than a thousand words.

A production example

Starting the demo app

git clone https://github.com/garronej/clean-redux
cd clean-redux
yarn
yarn build
yarn start-demo-app

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK