oracle-samples / xfc

A javascript library for Cross Frame Communication
Apache License 2.0
17 stars 24 forks source link

Add ability to 'fire and wait' a message #2

Open poloka opened 7 years ago

poloka commented 7 years ago

As a consumer or content provider I would like the ability to send and wait for a response to a message So that I may ask either the consumer or content provider for some information I will know when complete when I can send a message to say my consumer asking for a value and my consumer can listen and respond to that message back to the calling event.

A simple example would be for consumer that is about to refresh their page asks its content providers if they are dirty before allowing the entire page to be destroyed. And upon check the page either refreshes or a message is displayed. The logic for both sides of the fence and event names would have to be handled by the individual's implementation but looking for a reusable way to provide this 'fire and wait' type of model rather than a 'fire and forget'. Grated this could be accomplished by providing a payload with a return event name but would be nice if was a first class method.

mhemesath commented 6 years ago

I think this is a great request, and I'm open to adding this if you want to contribute it