Git Product home page Git Product logo

Comments (5)

JakeWharton avatar JakeWharton commented on July 30, 2024

You can use Strings as your events. Or any object. You don't have to make custom classes.

from otto.

411805662 avatar 411805662 commented on July 30, 2024

Strings carry less info 。sometime,we need pass a List or a Object.
if i post(new User()), that will cause more than one listener recieve this event, but actually i just hope one of them accept.

from otto.

JakeWharton avatar JakeWharton commented on July 30, 2024

The bus pattern has no control over the number of subscribers. If you need tighter control, use a different pattern.

from otto.

411805662 avatar 411805662 commented on July 30, 2024

i means I need a filter to tell subscriber whether should accept the event。and how to design the filter

from otto.

JakeWharton avatar JakeWharton commented on July 30, 2024

General questions about event bus usage should be asked on StackOverflow using the 'otto' tag. GitHub issues are for future features and bugs. We have no plans to add any kind of filtering feature since a bus is a one-to-many publisher.

from otto.

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.