Skip to content

Commit 831301f

Browse files
committed
v0.1.1 - change watchList signature
1 parent bf0e760 commit 831301f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ These properties are added to the Pointer object properties.
9696
will use File._\_create or Folder._\_create depending on existence of content
9797
* __delete([force],[callback]) - delete folder from system, force will decide if rimraf or fs.rmdir is used
9898
* __list(callback) - use fs.readdir and return results
99-
* __watchList(callback, [persistent]) - watch the folder changes and run __list on changes to the folder
99+
* __watchList([persistent], callback) - watch the folder changes and run __list on changes to the folder
100100
* __removeChild(opts) - remove a child object either by property name or object
101101

102102

lib/folder.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ function Folder(obj) {
114114
}
115115
},
116116
__watchList: {
117-
value: function (callback, persistent) {
117+
value: function (persistent, callback) {
118+
if(typeof persistent === 'function') {
119+
callback = persistent;
120+
persistent = false;
121+
}
118122
pointer.__listen('change', self.__list.bind(self, callback));
119123
pointer.__listen('error', self.__list.bind(self, callback));
120124
pointer.__listen('missing', callback);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"files",
88
"pointer"
99
],
10-
"version": "0.1.0",
10+
"version": "0.1.1",
1111
"repository": {
1212
"type": "git",
1313
"url": "git@github.com:DeadAlready/node-file-pointer"

0 commit comments

Comments
 (0)