'Phaser 3 Multiple Pointer Events in one

I currently have two pointer events which essentially do the same thing:

gameState.idle.on('pointerout', function(){
    scene.sys.canvas.style.cursor = 'default';
    gameState.pet_cursor.alpha = 0;
});
gameState.idle.on('pointerup', function(){
    scene.sys.canvas.style.cursor = 'default';
    gameState.pet_cursor.alpha = 0;
});

Is there any way to combine these two? For example, I tried gameState.idle.on('pointerup, pointerout', function(){});, but that evidently didn't work.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source