GithubHelp home page GithubHelp logo

crazycodeboy / react-native-event-bus Goto Github PK

View Code? Open in Web Editor NEW
47.0 3.0 7.0 6 KB

Event bus for react native, cross-interface communication solution, it works on iOS and Android.

License: MIT License

JavaScript 100.00%
eventbus react-native react-native-eventbus event-handler event-bus

react-native-event-bus's Introduction

react-native-event-bus

release PRs Welcome NPM version License MIT

Event bus for react native, cross-interface communication solution, it works on iOS and Android.

Content

Installation

  • 1.Run npm i react-native-event-bus --save
  • 2.import EventBus from 'react-native-event-bus'

Getting started

Add react-native-event-bus to your js file.

import EventBus from 'react-native-event-bus'

Inside your component's render method, use CheckBox:

fireEvent

EventBus.getInstance().fireEvent("your event name", {
    ...params
})

//

addListener

componentDidMount() {
    EventBus.getInstance().addListener("your event name", this.listener = data => {
        // handle the event
    })
}

componentWillUnmount() {
    EventBus.getInstance().removeListener(this.listener);
}

Contribution

Issues are welcome. Please add a screenshot of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.

Pull requests are welcome. If you want to change API or making something big better to create issue and discuss it first.


MIT Licensed

react-native-event-bus's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-event-bus's Issues

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.