Skip to content

Commit

Permalink
mutex optional second param
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Apr 24, 2019
1 parent 13a17e4 commit ec2be4f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mutex.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

/**
* @callback mutex
* @param {function():void} cb Only executed when this mutex is not in the current stack
* @param {function():void} [elseCb] Executed when this mutex is in the current stack
*/

/**
* Creates a mutual exclude function with the following property:
*
Expand All @@ -11,7 +17,7 @@
* })
* })
*
* @return {function(function():void,function():void):void} A mutual exclude function
* @return {mutex} A mutual exclude function
* @public
*/
export const createMutex = () => {
Expand Down

0 comments on commit ec2be4f

Please sign in to comment.