Giter VIP home page Giter VIP logo

signals's People

Contributors

ilyagazman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

signals's Issues

Maven Version

Good afternoon Sir!

Would it be possible to also publish a Maven Version of this wonderful library?

Thanks in advance

removeListener does not remove listener

Removing a listener does not work at all.

Log.d(TAG, "---------------Test 1------------")
val sig = Signals.localSignal(TestSignal1::class)
Log.d(TAG, "BEFORE has: ${sig.hasListeners()}") // false
sig.addListener(::testSig)
Log.d(TAG, "AFTER ADD has: ${sig.hasListeners()}") // true
sig.removeListener(::testSig)
Log.d(TAG, "AFTER REMOVE has: ${sig.hasListeners()}") // true

Log.d(TAG, "---------------Test 2------------")
val sig2 = Signals.localSignal(TestSignal2::class)
Log.d(TAG, "BEFORE has: ${sig2.hasListeners()}") // false
sig2.addListener { s -> Log.d("test", s) }
Log.d(TAG, "AFTER ADD has: ${sig2.hasListeners()}") // true
sig2.removeListener { s -> Log.d("test", s) }
Log.d(TAG, "AFTER REMOVE has: ${sig2.hasListeners()}") // true

Log.d(TAG, "---------------Test 3------------")
val sig3 = Signals.signal(TestSignal3::class)
Log.d(TAG, "BEFORE has: ${sig3.hasListeners()}") // false
sig3.addListener(::testSig)
Log.d(TAG, "AFTER ADD has: ${sig3.hasListeners()}") // true
sig3.removeListener(::testSig)
Log.d(TAG, "AFTER REMOVE has: ${sig3.hasListeners()}") // true

Log.d(TAG, "---------------Test 4------------")
val sig4 = Signals.signal(TestSignal4::class)
Log.d(TAG, "BEFORE has: ${sig4.hasListeners()}") // false
sig4.addListener { s -> Log.d("test", s) }
Log.d(TAG, "AFTER ADD has: ${sig4.hasListeners()}") // true
sig4.removeListener { s -> Log.d("test", s) }
Log.d(TAG, "AFTER REMOVE has: ${sig4.hasListeners()}") // true

fun testSig(s: String) {
}

fun interface TestSignal1 {
    fun test(s: String)
}

fun interface TestSignal2 {
    fun test(s: String)
}

fun interface TestSignal3 {
    fun test(s: String)
}

fun interface TestSignal4 {
    fun test(s: String)
}

 ---------------Test 1------------
BEFORE has: false
AFTER ADD has: true
AFTER REMOVE has: true
---------------Test 2------------
BEFORE has: false
AFTER ADD has: true
AFTER REMOVE has: true
---------------Test 3------------
 BEFORE has: false
AFTER ADD has: true
AFTER REMOVE has: true
---------------Test 4------------
BEFORE has: false
AFTER ADD has: true
AFTER REMOVE has: true

Samsung

This library doesn't work on Samsung devices, doesn't allow to install apk, says it conflicts with an existing package

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.