View Redux-Observable Redux-Saga
//Epic
export default function searchUsers(action$) {
return action$.ofType(ActionTypes.SEARCHED_USERS)
.map(action => action.payload.query)
.filter(q => !!q)
.switchMap(q =>
Observable.timer(800) // debounce
.takeUntil(action$.ofType(ActionTypes.CLEARED_SEARCH_RESULTS))
.mergeMap(() => Observable.merge(
View gist:100cd98b01821ba16c88
var ModelEventsMixin = {
shouldComponentUpdate: () => false,
componentWillMount: function () {
var self = this;
this.modelsToListen.forEach(function (model_name) {
eventEmitter.addListener(model_name + '_model_update', self.listener); // PROBLEM if I hange listener to forceUpdate.
});
},
componentWillUnmount: function () {
View loop
co(
for (var i in list) {
try {
yield promiseMeSomething(list[i]);
} catch (err) {
console.log(err.message);
}
})()
View gist:a9d1756aae24549ebf58
function traceurPromise() {
console.log('STARTING TRACEUR ');
return new Promise(function (resolve, reject) {
gulp.src(es6files)
.pipe(traceur(traceurOpts))
.pipe(gulp.dest(distDirectory))
.on('end', function () {
console.log('ENDED TRACEUR ');
resolve();
});
View gist:a0b24e0fc7f821a2dafe
/*
* FILES
* */
var unitTestFiles = 'dist/**/**.spec.js',
integrationTestFiles = 'dist/**/**.integSpec.js',
distJsFiles = 'dist/**/*.js',
es6files = 'es6/**/*.js';
/*
* Directories
View gist:94f4fd79fa9bd5d62e1b
gulp.task('watch-prod', ['templates', 'js-prod', 'sass'], function () {
livereload.listen();
gulp.watch('js/**/*.html', ['templates']);
gulp.watch(['js/**/*.js', 'dist/templates.js'], ['js-prod']);
gulp.watch('**/*.scss', ['sass']);
gulp.watch(['dist/**']).on('change', livereload.changed);
});
View gulpfile.js
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
rename = require("gulp-rename"),
ngAnnotate = require('gulp-ng-annotate'),
sourcemaps = require('gulp-sourcemaps'),
livereload = require('gulp-livereload'),
templateCache = require('gulp-angular-templatecache'),
compass = require('gulp-compass');