WebAPI/ProposedDeviceStorageAPIWithNotifications: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 37: Line 37:
   // Create a watcher which will call the callback function every time files are updated
   // Create a watcher which will call the callback function every time files are updated
   // callback will take the DeviceStorage, the file's name, and the update type, which will be one of "created", "deleted", or "modified"
   // callback will take the DeviceStorage, the file's name, and the update type, which will be one of "created", "deleted", or "modified"
   boolean addFileWatcher(Function callback);
  // If name is passed, the file watcher will only watch the file with the specified name.
   boolean addFileWatcher(Function callback, optional DOMstring name);
   
   
   // returns true if there was a watcher with this id, and false otherwise.
   // returns true if there was a watcher with this id, and false otherwise.
   boolean removeFileWatcher(Function callback);
   boolean removeFileWatcher(Function callback, optional DOMstring name);
   
   
   // See interface below for how to use this
   // See interface below for how to use this
22

edits

Navigation menu