Better syntax by removing .pipe()
See original GitHub issueIs there any reason for using .pipe()
to chain the actions? Chaining them directly would make more sense to me.
Current syntax
// Styles
gulp.task('styles', function() {
return gulp.src('src/styles/main.scss')
.pipe(sass({ style: 'expanded', }))
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(gulp.dest('dist/styles'))
.pipe(rename({ suffix: '.min' }))
.pipe(minifycss())
.pipe(livereload(server))
.pipe(gulp.dest('dist/styles'))
.pipe(notify({ message: 'Styles task complete' }));
});
Proposed syntax
// Styles
gulp.task('styles', function() {
return gulp.open('src/styles/main.scss') // open instead of gulp.src()
.sass({ style: 'expanded', })
.autoprefix() // verb instead of noun
.save('dist/styles') // save instead of gulp.dest()
.rename({ suffix: '.min' })
.minifycss()
.livereload(server)
.save('dist/styles') // save instead of gulp.dest()
.notify({ message: 'Styles task complete' });
});
Does it make sense?
Issue Analytics
- State:
- Created 10 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Write Clean Python Code Using Pipes - Towards Data Science
Pipe is a Python library that enables you to use pipes in Python. A pipe ( | ) passes the results of one...
Read more >Syntax checker incorrectly flags pipe operator after multiline ...
Describe the problem in detail. The following code generates the "unexpected token" warning. library(magrittr) "abc " %>% nchar().
Read more >Removing NA in dplyr pipe [duplicate] - Stack Overflow
I used na.omit for all columns and it worked. outcome.df is a subset of large dataset. I'm trying to rank the conditions in...
Read more >Transforming Data Using Pipes - Angular
Some pipes require at least one parameter and allow more optional parameters, such as SlicePipe . For example, {{ slice:1:5 }} creates a...
Read more >Simplify Your Code with %>%
Removing duplication is an important principle to keep in mind with your code; ... by the magrittr package is %>% , or what's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, that is not how streams work. Please review the docs on stream basics.
If you really wanted this behavior you could write a library that loads stuff onto the Stream prototype like so
This would let you chain stuff