Giter Site home page Giter Site logo

badoo / decompose Goto Github PK

View Code? Open in Web Editor NEW
817.0 25.0 41.0 65.76 MB

Kotlin Multiplatform lifecycle-aware business logic components (aka BLoCs) with routing functionality and pluggable UI (Jetpack Compose, SwiftUI, JS React, etc.), inspired by Badoos RIBs fork of the Uber RIBs framework

Home Page: https://arkivanov.github.io/Decompose

License: Apache License 2.0

Kotlin 100.00%
android jetpack-compose components kotlin tree-structure multiplatform lifecycle lifecycle-aware-components hacktoberfest

decompose's Introduction

Maven Central License Twitter URL

badge badge badge badge badge badge badge

Maintenance notice

This repository is not maintained. Arkadii Ivanov continued to work on the fork arkivanov/Decompose.

Decompose

Please see the project website for documentation and APIs.

Decompose is a Kotlin Multiplatform library for breaking down your code into lifecycle-aware business logic components (aka BLoC), with routing functionality and pluggable UI (Jetpack Compose, Android Views, SwiftUI, JS React, etc.). This project is inspired by Badoos RIBs fork of the Uber RIBs framework.

Setup

Please check the Installation section of the documentation.

Overview

Here are some key concepts of the library, more details can be found in the documentation.

  • Component - every component represents a piece of logic with its own lifecycle, the UI is optional an is plugged externally
  • ComponentContext - every component has its own [ComponentContext], which makes components lifecycle-aware and allows state preservation, instances retaining (aka AndroidX ViewModel) and back button handling
  • Router - enables navigation between child components, nested navigation is also supported
  • Lifecycle - provides a way to listen for lifecycle events in components
  • StateKeeper - makes it possible to preserve state or data in a component when it gets destroyed
  • InstanceKeeper - retains instances in your components (similar to AndroidX ViewModel)
  • BackPressedHandler - provides a way to handle and intercept back button presses

Component hierarchy

Pluggable UI hierarchy

Typical component structure

Samples

Check out the project website for a full description of each sample.

Articles

Author

Twitter: @arkann1985

If you like this project you can always Buy Me A Coffee ;-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.