Coder Social home page Coder Social logo

logging dispatched payloads about flummox HOT 7 CLOSED

acdlite avatar acdlite commented on May 5, 2024
logging dispatched payloads

from flummox.

Comments (7)

tappleby avatar tappleby commented on May 5, 2024

In my projects I've been just been registering logging directly on the dispatcher, avoids having to override any methods.

from flummox.

acdlite avatar acdlite commented on May 5, 2024

I think best way to handle this would be to make the Flux class an event emitter (#10) that emits on dispatch.

from flummox.

vesparny avatar vesparny commented on May 5, 2024

@tappleby Are you accessing the dispatcher? I never felt the need of doing that nor manually calling the dispatch method.
Could you post an example?

@acdlite I think you are right, this way we won't need to access internals.

from flummox.

acdlite avatar acdlite commented on May 5, 2024

Dispatch event added in 2.10. About to add to docs.

from flummox.

acdlite avatar acdlite commented on May 5, 2024

Done

from flummox.

vesparny avatar vesparny commented on May 5, 2024

@acdlite you're suuuuuper fast!
Just integrated in my sample project, it's a great feature for seeing what's going on in your app.
https://github.com/vesparny/flux-immutable-example/blob/master/src/Flux.js#L20

from flummox.

tappleby avatar tappleby commented on May 5, 2024

@vesparny its not relevant now with the dispatch event, but I had been accessing it directly to see everything going through the dispatcher. Normally I wouldn't access the dispatcher directly but felt debug logging was an acceptable use case:

let flux = new Flux();
if (DEBUG) {
    flux.dispatcher.register((payload) => console.log('dispatch ->', payload));
}

I have also thought of using the dispatcher for analytics purposes.

from flummox.

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.