Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watch callbacks should have access to public instance #631

Closed
shakyShane opened this issue May 21, 2015 · 4 comments · May be fixed by tobybellwood/govstrap#4
Closed

watch callbacks should have access to public instance #631

shakyShane opened this issue May 21, 2015 · 4 comments · May be fixed by tobybellwood/govstrap#4

Comments

@shakyShane
Copy link
Contributor

re: #411

Example use-case, when using bs-config

module.exports = {
    server: './app',
    files: [
        './app/*.html',
        './app/js/*.js',
        {
            options: {
                ignoreInitial: true
            },
            match: './app/css/*.css',
            fn: function (event, file) {
                if (event === 'change') {
                    this.reload(file);
                }
            }
        }
    ]
};
@zanona
Copy link

zanona commented May 22, 2015

Hey @shakyShane may I ask what does Chokidar ingoreInitial option does in this case?
I read their docs but couldn't quite figure out. Thanks

@shakyShane
Copy link
Contributor Author

it fires add events for each file that it finds on the initial file system scan.

@shakyShane
Copy link
Contributor Author

remove it, & put a log in to see what i mean

module.exports = {
    server: './app',
    files: [
        './app/*.html',
        './app/js/*.js',
        {
            match: './app/css/*.css',
            fn: function (event, file) {
                console.log(event);
            }
        }
    ]
};

@zanona
Copy link

zanona commented May 22, 2015

Ah yes. Got it! so setting it to true will basically ignore those add events which is nice once only focusing on change events. Thanks man.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants