Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added documentation about pooled events #4634

Merged
merged 2 commits into from
Aug 17, 2015

Conversation

edvinerikson
Copy link
Contributor

Added documentation about pooled events, some feedback is very welcome.
Related to #4514
cc @jimfb


> Note:
>
> If you want to access event properties in an asynchronous way, you need to create a new object e.g `var copiedEvent = assign({}, event);` or assign the specific properties to variables.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to access the event properties in an asynchronous way, you should call event.persist() on the event, which will remove the synthetic event from the pool and allow references to the event to be retained by user code.

@jimfb
Copy link
Contributor

jimfb commented Aug 15, 2015

Looks pretty good. One minor thing: we should mention event.persist() instead of having the user manually copy the event.

I'm also going to let the PR sit for a couple days so everyone has a chance to take a look before we merge.

@edvinerikson
Copy link
Contributor Author

Thanks for the feedback.
Sounds good to me. 👍

jimfb added a commit that referenced this pull request Aug 17, 2015
Added documentation about pooled events
@jimfb jimfb merged commit d984b68 into facebook:master Aug 17, 2015
@jimfb
Copy link
Contributor

jimfb commented Aug 17, 2015

@edvinerikson Thanks!

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

Successfully merging this pull request may close these issues.

3 participants