defunkt/jquery-pjax — pull request #384 by lencioni (2014-05-05 19:10:05+00:00)
Title: Add `pjax:receive` event

We are using React [1] in combination with pjax. When the content of a
pjax container is updated, we need to unmount all React components.
Right now, we're doing this in a `pjax:beforeSend` event handler, but
that's far from ideal. We need an event to fire right before the content
has been updated, while the pjax container still has access to the old
content. This commit fixes that by adding a `pjax:receive` event that's
fired in the success handler right before we replace the content.

The name of the event was inspired by the equivalent event that
Turbolinks [2] fires.

Closes #383.

[1]: http://facebook.github.io/react/index.html
[2]: https://github.com/rails/turbolinks