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

Have fetching and serving as two separate tasks #9

Open
vincentorback opened this issue Dec 27, 2014 · 4 comments
Open

Have fetching and serving as two separate tasks #9

vincentorback opened this issue Dec 27, 2014 · 4 comments

Comments

@vincentorback
Copy link

Hey guys!
It would be sweet if the task stored a local store.json file for offline development so you don’t have to re-fetch the store data every time. So maybe have to separate tasks, one to fetch and one to serve.

Thanks!

@kalasjocke
Copy link
Contributor

@vincentorback I totally agree with you. Do you think it would make sense to ship some kind of binary with this tool to do tasks like that ($ tt fetch), or would it be to the developer to add the fetch task to their own Gulpfile?

@vincentorback
Copy link
Author

I was first thinking something like this:

var storeId = 'pf';

gulp.task('fetch', function() {
    tictail.fetch({
        store_id: storeId
    });
});

gulp.task('serve', function() {
    tictail.serve({
        store_id: storeId
    });
});

But that might be too much to ask from developers who doesn’t care about this feature.
Maybe you can disable fetch/serve as an option?

// Use this one for fetching
gulp.task('fetch', function() {
    tictail.serve({
        store_id: storeId,
        serve: false
    });
});

// Use this one for serving
gulp.task('serve', function() {
    tictail.serve({
        store_id: storeId,
        fetch: false
    });
});

Making it more optional to have two separate tasks.

@vincentorback
Copy link
Author

But if you have more use cases when you need a binary tool like tt that’d be nice as well! 😺

@ptz0n
Copy link
Contributor

ptz0n commented Jan 15, 2015

@vincentorback Great idea! Making the API cache support file storage (in addition to memory) will also do the trick.

Also having a separate fetch task would be convenient for this use case.

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

No branches or pull requests

3 participants