Re: Web Alarm API - idiomatic check

On Wednesday, May 8, 2013 at 7:07 PM, Jake Verbaten wrote:

> Look at the alarms api it's not obvouis how to get the id to remove an alarm from.
> 
> ```
> var request = navigator.alarms.add(date, "ignoreTimezone", {
> message: "Your soup is ready!"
> });
> 
> navigator.alarms.remove(request.id (http://request.id))
> ```
> 
> Should I read `request.id (http://request.id)` to get the request? If we can only get the id when the request resolves then it doesnt make sense to remove the alarm 
> once the alarm has already triggered.

Oh, d'oh! the example is using the old API :( Really sorry about that. Filed a bug: 
https://github.com/sysapps/web-alarms/issues/36




> It may be useful to have a recurring alarm primitive similar to setInterval.
> 
> If you want a pretty API consider parsing cron patterns ( http://crontab.org/ ) like node's cron module does ( https://github.com/ncb000gt/node-cron#another-cron-example )
Those links are super helpful, thanks! Filed a bug to add that as potential enhancement:
https://github.com/sysapps/web-alarms/issues/37 

I'm sure there are a ton of use cases. 

Received on Thursday, 9 May 2013 20:30:14 UTC