Merge pull request #22166 from lierdakil/patch-1

@types/atom: watchPath returns a Promise
This commit is contained in:
Arthur Ozga
2017-12-19 11:09:24 -08:00
committed by GitHub
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -1587,7 +1587,8 @@ function testPanel() {
}
// PathWatcher ================================================================
function testPathWatcher() {
async function testPathWatcher() {
const pathWatcher = await pathWatcherPromise;
pathWatcher.dispose();
subscription = pathWatcher.onDidError((error) => str = error.name);
@@ -3213,7 +3214,7 @@ function testWorkspaceCenter() {
}
// watchPath ==================================================================
const pathWatcher = Atom.watchPath("/var/test", {}, (events) => {
const pathWatcherPromise = Atom.watchPath("/var/test", {}, (events) => {
for (const event of events) {
str = event.path;
str = event.action;
+1 -1
View File
@@ -24,7 +24,7 @@ declare global {
* Project::onDidChangeFiles instead.
*/
export function watchPath(rootPath: string, options: {}, eventCallback: (events:
FilesystemChangeEvent) => void): PathWatcher;
FilesystemChangeEvent) => void): Promise<PathWatcher>;
// Essential Classes ==========================================================