daepark / postmessage

window postmessage plugin for cross-window messaging
http://postmessage.freebaseapps.com
179 stars 55 forks source link

No option for manually calling reply function in pm.bind #5

Open jonhoo opened 13 years ago

jonhoo commented 13 years ago

It is currently not possible to manually call the method causing a reply message to be sent in a function bound in pm.bind.

This could be very useful when the function bound by pm.bind performs an asynchronous operation, and such cannot reply straightaway.

Could be implemented as such: pm.bind_manual(type, fn, [origin], [hash]) And that fn then gets called with (data, callback), where fn calls callback when it has completed doing its job