I have the same issue with my dog. My trainer told me to ignore her, and when she calmed, to reward her then. I didn't find that worked, though it's a technique.
What has been working better is I have treats with me, the second she starts barking I call her over, do some tricks with her (target is a great one), and make her lay down. When she's down, I treat her. Usually the stimulus is still ongoing so when she's down she hears the stimulus, but I treat her for not reacting. I'm not completely successful yet, but her 'fits' are much shorter in duration, and she's more responsive to me in those moments.
What has been working better is I have treats with me, the second she starts barking I call her over, do some tricks with her (target is a great one), and make her lay down. When she's down, I treat her. Usually the stimulus is still ongoing so when she's down she hears the stimulus, but I treat her for not reacting. I'm not completely successful yet, but her 'fits' are much shorter in duration, and she's more responsive to me in those moments.