Comments (1)
const EventEmitter = require('events');
const ee = new EventEmitter();
function handler1() {
console.log('1');
}
function handler2() {
console.log('2');
}
ee.on('trigger', handler1);
ee.on('trigger', handler1);
ee.on('trigger', handler2);
ee.emit('trigger');
The above program output will be
1
1
2
After discussion with @jasonkit and @limouren and with above example, everyone agree that skygear.on()
can allow multiple subscription on the same handler function to avoid confusion with the EventEmitter come with the languages.
Since the original of this issue is skygear help people to re-subscribe automatically. But not clearly state in the https://docs.skygear.io/js/guide/pubsub . So proper resolution will be a polish of documentation.
from skygear-sdk-js.
Related Issues (20)
- Drop realm
- Unable to import defaultContainer in v2.0.0-alpha.15 using JS SDK HOT 3
- Update API documentation
- Support OAuth and Sign in with Apple in React Native
- Include license banner in bundle
- Add identity APIs
- Support using auth ui to login with OIDC flow
- Update MFA step names
- Update using CustomTabsIntent for authorization flow in android
- Move oidc functions to another namespace HOT 1
- Update README to mention localhost DNS resolver is required
- Remove unused fields in OIDCConfiguration
- Compatibility with v2.4
- [Bug] React native auth ui treats user cancel as unable to open url error HOT 10
- How to detect cancel in authorization flow HOT 14
- Fix react native bundle warning
- React native upload asset fails in Android HOT 1
- SDK throws error when first time login/signup with facebook using auth ui HOT 2
- Allow explicitly set auth ui locale in react native sdk HOT 1
- Support providing extra query parameters to authorization URL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skygear-sdk-js.