Skip to content
プロジェクト

概要

Kotlin、コルーチン、Retrofitをベースにした、簡単で軽量なネットワークリクエストのラッパー。

システム・インフラ

この数値の測り方

計測したスター増加

24時間
-1
7日間
-1
15日間
-1
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

简体中文

Three ways to encapsulate Retrofit + Kotlin Coroutines for elegant and fast network requests

Introduction

This project involves three ways to encapsulate Retrofit + Kotlin Coroutines, each encapsulation idea is different.

Even if you are not familiar with the concatenation and Kotlin flow, you can get started quickly.

The purpose of the wrappers is to reduce boilerplate code and facilitate rapid development.

Branching Explained

  • Encapsulation 1 (corresponding to branch oneWay) passes ui references, allowing deep ui customization according to the project, which is fast and convenient, but highly coupled (Google's recent architecture documentation no longer recommends using LiveData in the repository). Google's recent architecture documentation no longer recommends the use of LiveData in the Repository, this approach mainly provides a kind of encapsulation of ideas)

  • Encapsulation two (corresponding to branch master) is low coupling, few dependencies, but more template code.

  • Encapsulation 3 (corresponding to branch dev) aims to reduce boilerplate code, introduces the new flow stream programming, chaining calls, loading and network requests and result processing are all together, and in many cases don't even declare the LiveData/Flow objects.

According to the latest architecture of Google's official documentation, advancing the use of dev branches.

Blog address

Acknowledgments

Some of the ideas of the project come from other open source projects, thanks to other authors for their selfless contributions.

The project debugging Api comes from wanandroid of Hongyang God, thanks for providing free and stable api.

I hope we can have a harmonious and friendly communication to build an open source community.

Translated with DeepL

Star History

関連プロジェクトを探す

読み込み中…