#381 - listen to events on demand#462
Conversation
…I have the right idea.
|
Let's ignore the window resize and whatever other events that React attaches and uses internally for now. If possible, it would be great to end up removing those entirely but that should probably be a separate effort. |
There was a problem hiding this comment.
React codebase convention is to have a single var statement for each declaration.
|
9:41:05 PM sspi I removed touchNotMouse, and I want to re-add it 11:02:11 PM sspi balpert: I'm having second thoughts on the eventplugin dependencies |
There was a problem hiding this comment.
Move ] to next line
…mand-events Conflicts: src/core/ReactEventEmitter.js
|
Had a discussion with @spicyj about testing events to ensure that they are happening. This would be really nice to have, however I would prefer to add these types of tests within a separate PR. |
This module-level mock() seems to have been interfering with other tests (26 specs failing). We don't have any other tests that do a module-level mock() so I'm going to assume it isn't supported in the open-source test runner right now. I changed it so only ReactEventEmitter.handleTopLevel is mocked; doing so made ReactEventEmitter complain that TopLevelCallbackCreator wasn't defined so I switched the ReactMount references to use React directly so that ReactDefaultInjection would kick in properly. With this, all the tests pass.
- Implemented EventPlugin dependencies - Moved supportTouch to EventPlugin level
There was a problem hiding this comment.
style nit: requires should always be alphabetized.
There was a problem hiding this comment.
Could the logic here to find the container and execute listenTo be put into ReactEventEmitter.putListener? Then it doesn't even have to be exposed on ReactEventEmitter and could be re-used below.
|
Added a bunch of comments — some are from me, some are from @petehunt. Thanks for tackling this! |
|
@yungsters @petehunt - thanks for the review. |
…mand-events Conflicts: src/core/React.js
…mand-events Conflicts: src/core/React.js
registrationNameEventNames -> registrationNameDependencies
|
And 🚢ed! 80d7d2d |
|
Awesome! |
There was a problem hiding this comment.
There are a few lines over 80 chars, this is one
Fixes #381 This is a squashed version of facebook/react#462
Fixes #381.
Changes of @spicyj are now in.
Apologies for the overload of commits, had some git issues :-).