Skip to content

Instantly share code, notes, and snippets.

@michel-zimmer
Created November 9, 2016 09:03
Show Gist options
  • Save michel-zimmer/9ed3cd193bbedf40b1c1598332607497 to your computer and use it in GitHub Desktop.
Save michel-zimmer/9ed3cd193bbedf40b1c1598332607497 to your computer and use it in GitHub Desktop.
/**
* Executes callback with the latter execution of a() and b().
*
* Example:
* let x = ab((a, b) => {
* console.log(a, b);
* });
* x.a();
* x.b(1234);
*
* // Output: undefined 1234
*/
module.exports=(c)=>{var a={d:c,e:!1,f:!1,g:void 0,h:void 0,a:(b)=>{a.e=!0;a.g=b;a.e&&a.f&&a.d(a.g,a.h)},b:(b)=>{a.f=!0;a.h=b;a.e&&a.f&&a.d(a.g,a.h)}};return a};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment