export function checkEitherLoggedInOrNot(){ 
    let options = {
        method:'GET',
        credentials:'include',
        mode: 'cors'
    };
    return ajaxRequest('https://repo.asda.ru/app_dev/Auth',options)
        .then(data => {
            //Тут возвращай что нужно
            return data;
        })
        .catch(error => console.log(error));
}
checkEitherLoggedInOrNot().then(result => { 
    // где result тот результат, который ты вернул
 })function getDefaultState() {
	return {
		title: '',
		year: '',
		format: '',
		actors: ''
	};
}
export default React.createClass({
	handleFilmAdd() {
    this.props.onFilmAdd({
			id: 'some_id',
			...this.state
		});
		this.setState(getDefaultState());
  },
	handleChange(field, value) {
		this.setState({
			[field]: value
		});
	}
  render() {
    return (
    	<div>
       <input
        value={this.state.title}
				onChange={this.handleChange.bind(this, 'title')}
        placeholder='Title'
        ref='addTitle'
      />
      	<input
        value={this.state.year}
				onChange={this.handleChange.bind(this, 'year')}
        placeholder='Release Year'
        ref='addYear'
      />
        <input
        value={this.state.format}
				onChange={this.handleChange.bind(this, 'format')}
        placeholder='Format'
        ref='addFormat'
      />
      <textarea
	      value={this.state.actors}
				onChange={this.handleChange.bind(this, 'actors')}
	      placeholder='Actors'
	      ref='addActors'>
      </textarea>
      <button onClick={this.handleFilmAdd}>Add</button>
      </div>
    );
  }
});const through2 = require('through2').obj;
gulp.task('jade', function (callback) {
  return gulp.src(config.src.jade)
  .pipe(plumber())
  .pipe(jade({
    pretty: true // Комментарии и отформатированный код.
  }))
  .pipe(gulp.dest(config.dev.html))
  .pipe(gulpif(!isDevelopment, htmlmin({
    collapseWhitespace: true,
    removeComments: true
  })
  .pipe(through2((file, enc, cb) => {
    if (isDevelopment) { // задаем условие
	   callback(); // выходим из таска
    } else {
	   cb(null, file); // передаем файлы дальше в поток
    }
  }))
  .pipe(gulp.dest(config.prod.html)) 
})class Store extends EventEmitter {
    constructor() {
        super();
        this._dispatchToken = dispatcher.register(this._registerToActions.bind(this));
      
        this._id = 1;
    }
    _registerToActions(action) {
        switch(action.actionType) {
            case GENERATE_NEW_ID:
                this._id += action.id;
                this.emit(GENERATE_NEW_ID);
                break;
            default:
                break;
        }
        return true;
    }
    get id() {
        return this._id;
    }
}
class Listener extends React.Component {
    constructor() {
        super();
        this.go = this.go.bind(this);
        Store.on(GENERATE_NEW_ID, this.go);
        this.state = {
            id: Store.id
        };
    }
    go() {
        this.setState({
            id: Store.id
        })
    }
}function build(theme) {
    return new Promise(function(resolve) {
        gulp.src([theme])
        ...
        resolve();
    });
}
var themeList = []; // Список стилей
gulp.task('build:themes', function() {
    return Promise.all(themeList.map(function(theme) {
        return build(theme);
    })).then(function() {
        // Отработает после того, как завершится сборка всех стилей
    });
});
gulp.task('build', function() {
    var theme =  'src/styles/' + (util.env.theme ? util.env.theme : 'main') + '.scss';
    build(theme);
});