Skip to content

Conversation

@ericraio
Copy link
Contributor

No description provided.

@ericraio
Copy link
Contributor Author

ericraio commented Feb 1, 2016

@SEthX I added the events here but I am still trying to figure out how to emit the pop event when you swipe to go back. Any ideas?

@charpeni
Copy link
Contributor

charpeni commented Feb 1, 2016

goBackwards ?

@davidLeonardi
Copy link
Contributor

@ericraio You're saying that adding an emitter to onBack doesn't do the trick?

@davidLeonardi
Copy link
Contributor

Ah i see what's going on.
Seems that the "back" swipe is handled directly by the Navigator.
this.navigationContext.emit('willfocus', {route: route}); is how this occurs, in Navigator.js .

EventEmitter.js is what is actually the emitter implementation.
I hope this works with fbemitter, if not we should switch this to using the emitter provided by RN instead of fbemitter.

@davidLeonardi
Copy link
Contributor

@charpeni @ericraio On second thought I've been having issues with fbemitter lately, mainly because it also is included by "flux" , but at a 0.1 alpha something version, which breaks my local packer.
So how about we just switch to the emitter used by RN instead?
The emitter implementation can be found here: react-native/Libraries/vendor/emitter/EventEmitter.js

What the router can then do, is listen to this emitted event, and emit an event itself, essentially becoming the main emitter for routing/navigation.

Thoughts?

davidLeonardi added a commit that referenced this pull request Feb 2, 2016
broadcasting events based on navigator actions
@davidLeonardi davidLeonardi merged commit 35c9f0a into react-native-simple-router-community:master Feb 2, 2016
@davidLeonardi
Copy link
Contributor

Merging this and will implement the change for this myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants