Yes -- taking it a step further, moving it into the Alarm class.

On 4/1/14, 9:44 AM, Miller Medeiros wrote:
> In apps/clock/js/panels/alarm/active_alarm.js:
>
>>          if (err) {
>>            done();
>>            return;
>>          }
>> +
>> +        this.popAlert({
>> +          type: 'alarm',
>> +          label: alarm.label,
>> +          sound: alarm.sound,
>> +          vibrate: (alarm.vibrate && alarm.vibrate !== '0'),
>> +          time: date,
>> +          id: alarm.id
>> +        });
>> +
>> +        var afterSave = () => {
>> +          window.dispatchEvent(new CustomEvent('alarm-changed', {
>
> abstract this into a discrete method since it's used twice with same
> args: |this._dispatchAlarmChange(alarm)|
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mozilla-b2g/gaia/pull/16746/files#r11168936>.
>