GithubHelp home page GithubHelp logo

Comments (3)

mdiep avatar mdiep commented on April 28, 2024

So, I say we either pull it, or come with some compelling real-world cases outside of UI code where this holds value.

TBH, I'm not sure how much value Action itself has outside of UI code. It's primary benefits, like serialization, are mostly important in a long-lived process.

But I'll try to think of an example where it'd be useful.

from reactiveswift.

liscio avatar liscio commented on April 28, 2024

@mdiep one that I came up with myself was a "bridge to the imperative world" similar to the following:

final class SomeDatabaseThingy {
    // Something that performs a flush of the underlying database on a successful fetch
    let flushAction: Action<Bool, Void, NoError> 

    let fetchOperation: SignalProducer<SomeValue?, NoError>

    func doAFetch() {
        fetchOperation.startWithSignal { signal, _ in
            // Something that stores the fetchOperation result in the database
            someProperty <~ signal
            flushAction <~ signal.map { $0 != nil }
        }
    }
}

The alternative, of course, would be to use .on(next:) to call the database's flush operation. This is likely not a great example of usage, but it was all I could come up with. :)

from reactiveswift.

liscio avatar liscio commented on April 28, 2024

I think that it makes more sense to simply discourage things like dismissAnimated() being wrapped in actions rather than taking away this potentially useful feature.

I'm closing this one out so we don't have to waste any more cycles on it…

from reactiveswift.

Related Issues (20)

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.