Eventbus implemented by Flow

Related tags

EventBus flowbus
Overview

FlowBus

FlowVersion EventBus

Usage

Add it in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}


	dependencies {
	        // core
	        implementation 'com.github.lwj1994.flowbus:flowbus:tag'
	        implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0"

	        // android
	        implementation 'com.github.lwj1994.flowbus:flowbus-android:tag'
	        implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
            implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-alpha02")
	}
       // receive event in scope
       receiveScope.launch {
            delay(1000)
            FlowBus.observe<Event> {
                println(it.a)
                // only receive 3
                assert(it.a == 3)
            }
       }

       // post event
       FlowBus.post(Event(1))

Android

        // receive event bind lifecycleOwner
        FlowBus.observeLifecycle<Event>(lifecycleOwner) {

        }
You might also like...
An efficient TabLayout library implemented with RecyclerView.
An efficient TabLayout library implemented with RecyclerView.

RecyclerTabLayout An efficient TabLayout library implemented with RecyclerView. Features Efficient when having many tabs Easy setup with ViewPager (sa

EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the  Etsy app.
EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the Etsy app.

EtsyBlur EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the past Etsy app. Try out the sa

An Android Library that allows users to pull down a menu and select different actions. It can be implemented inside ScrollView, GridView, ListView.
An Android Library that allows users to pull down a menu and select different actions. It can be implemented inside ScrollView, GridView, ListView.

AndroidPullMenu AndroidPullMenu is an Open Source Android library that allows developers to easily create applications with pull menu. The aim of this

A file/directory-picker for android. Implemented as a library project.
A file/directory-picker for android. Implemented as a library project.

Note: avoid using as SD-card file picker on Kitkat+ In Kitkat or above, use Android's built-in file-picker instead. Google has restricted the ability

Sample project created to show some of the best Android practices to work in the Android UI Layer. The UI layer of this project has been implemented using MVP or MVVM (without binding engine) to show how this patterns works. This project is used during the talk An efficient TabLayout library implemented with RecyclerView.
An efficient TabLayout library implemented with RecyclerView.

RecyclerTabLayout An efficient TabLayout library implemented with RecyclerView. Features Efficient when having many tabs Easy setup with ViewPager (sa

Material Design Search View Layout, now implemented in Google Maps, Dialer, etc

THIS PROJECT IS DEPRECATED Component is not maintained anymore. Implementation of Lollipop+ Dialer and Google Maps. DEMO Add in View Add to your layou

Design Patterns implemented in Kotlin

Design Patterns In Kotlin ⚠️ New article about testing: Unit Testing with Mockito 2 Project maintained by @dbacinski (Dariusz Baciński) Inspired by De

Super Heroes Kata implemented using Jetpack Compose and Screenshot Testing.
Super Heroes Kata implemented using Jetpack Compose and Screenshot Testing.

KataSuperHeroes with Jetpack Compose We are here to learn about Jetpack Compose. We are going to use Jetpack Compose Testing Tools to interact with th

A simple Snake game implemented using Compose for Desktop
A simple Snake game implemented using Compose for Desktop

CompoSnake A simple Snake game implemented using Compose for Desktop. Run: ./gradlew run Author Twitter: @arkann1985 If you like this project you can

A kitchen timer implemented with Jetpack Compose
A kitchen timer implemented with Jetpack Compose

Kitchen Timer Motivation and Context To commemorate Jetpack Compose first beta release, Google launched the #AndroidDevChallenge. In the 2nd round, co

 Switch Snake implemented using Compose Desktop. Inspired by this tweet
Switch Snake implemented using Compose Desktop. Inspired by this tweet

🐍 switch-snake Switch Snake implemented using Compose Desktop. Inspired by this tweet ✨ Demo 📽️ Play Demo in Full Quality 🏃 Run ./gradlew run ✍️ A

A simple Snake game implemented using Compose for Desktop
A simple Snake game implemented using Compose for Desktop

A simple Snake game implemented using Compose for Desktop

A clone of hn.premii.com implemented in KMP with Web (React), iOS (Swift UI), Android and Desktop (Compose) UIs

An clone of hn.premii.com implemented in Kotlin Multiplatform with shared Android/Desktop Compose UI, SwiftUI on iOS and React for Web This example su

🔪  AOP development framework implemented through *Annotation + ASM + Gradle Transform API*  for Android🤖
🔪 AOP development framework implemented through *Annotation + ASM + Gradle Transform API* for Android🤖

🔪 AOP development framework implemented through *Annotation + ASM + Gradle Transform API* for Android🤖

An application that simulate the Swedish Transport Agency, implemented with Spring Boot, Kotlin and GraphQL

graphql-kotlin-spring-server An application that simulate the Swedish Transport Agency, implemented with Spring Boot, Kotlin and GraphQL Running the s

GoogleMaps with its all feature implemented.
GoogleMaps with its all feature implemented.

In this project, I have implemented Map Style Pointer On Map Long Press pointer add On Option Item Selected on Map Option Menu Location Enable Button

QRCode Generator implemented in pure Kotlin

Creating QRCodes in Kotlin and Java is harder than it should be. QRCode-Kotlin aims to bring a simple, straightforward and customizable way to create QRCodes into the JVM domain, especially in the backend.

Slime loader is a map loader & saver for the file format Slime as specified here implemented in Minestom.

🗺️ SlimeLoader Slime loader is a map loader & saver for the file format Slime as specified here implemented in Minestom. Features: World loading Bloc

Releases(0.0.2)
Owner
wenchieh
wenchieh
A lightweight eventbus library for android, simplifies communication between Activities, Fragments, Threads, Services, etc.

AndroidEventBus This is an EventBus library for Android. It simplifies the communication between Activities, Fragments, Threads, Services, etc. and lo

Mr.Simple 1.6k Nov 30, 2022
A Simple kotlin first EventBus implementation

EventBus Simple event bus for event-driven programming. Taking advantage of kotlin language features instead of typical reflections Table of Contents

Zarzel K. Shih 4 Oct 14, 2022
eventbus-intellij-plugin 3.8 0.0 L1 Java Plugin to navigate between events posted by EventBus.

eventbus-intellij-plugin Plugin to navigate between events posted by EventBus. Post to onEvent and onEvent to Post Install There are two ways. Prefere

Shinnosuke Kugimiya 315 Aug 8, 2022
An E-Commerce android App whose frontend is implemented using Kotlin & XML files and backend/database is implemented using My SQL & PHP files

An E-Commerce android App whose frontend is implemented using Kotlin & XML files and backend/database is implemented using My SQL & PHP files

null 4 Aug 25, 2022
Dead simple EventBus for Android made with Kotlin and RxJava 2

KBus Super lightweight (13 LOC) and minimalistic (post(), subscribe(), unsubscribe()) EventBus written with idiomatic Kotlin and RxJava 2 KBus in 3 st

Adriel Café 46 Dec 6, 2022
EventBus for Android,消息总线,基于SharedFlow,具有生命周期感知能力,支持Sticky,支持线程切换,支持延迟发送。

背景 跨页面通信是一个比较常见的场景,通常我们会选择使用EventBus,但EventBus无法感知声明周期,收到消息就会回调,所以有了LiveData之后很快就有了LiveEventBus。不过它也有缺点,比如不能切换线程。

BiuBiuQiu0 167 Jan 3, 2023
Realize EventBus with LiveData

LiveDataBus 增強UnPeek-LiveData,將其包裝成觀察者模式的事件總線 Getting started Add it in your root build.gradle at the end of repositories: allprojects { repositor

JaredDoge 2 Oct 25, 2022
A lightweight eventbus library for android, simplifies communication between Activities, Fragments, Threads, Services, etc.

AndroidEventBus This is an EventBus library for Android. It simplifies the communication between Activities, Fragments, Threads, Services, etc. and lo

Mr.Simple 1.6k Nov 30, 2022
A Simple kotlin first EventBus implementation

EventBus Simple event bus for event-driven programming. Taking advantage of kotlin language features instead of typical reflections Table of Contents

Zarzel K. Shih 4 Oct 14, 2022
Sample demonstrates use of Flow, StateFlow & how we can test Flow

FlowSample This sample demonstrates use of Flow, StateFlow & how we can test Flow. In Kotlin, Coroutine is just the scheduler part of RxJava but now w

null 0 Oct 24, 2021