Skip to content

Instantly share code, notes, and snippets.

View arackaf's full-sized avatar
🏠
Working from home

Adam Rackis arackaf

🏠
Working from home
View GitHub Profile
gulp.task('transpile', function() {
return gulp.watch('**/**-es6.js', function(obj){
if (obj.type === 'changed') {
gulp.src(obj.path, { base: './' })
.pipe(plumber({
errorHandler: function (error) {
//babel error - dev typed in in valid code
if (error.fileName) {
var fileParts = error.fileName.split('\\');
try {
const bookSubjectManagerInitialState = () => ({
singleBookModify: null,
selectedBooksModify: false,
addingSubjects: {},
removingSubjects: {}
});
function bookSubjectManagerReducer(state = bookSubjectManagerInitialState(), action = {}){
switch (action.type){
case ENABLE_SUBJECT_MODIFICATION_FOR_SINGLE_BOOK:
const modifyingBooksSelector = createSelector(
[state => state.booksSubjectsModifier.singleBookModify, state => state.booksSubjectsModifier.selectedBooksModify, state => state.books],
(singleBookModify, selectedBooksModify, books) => {
let modifyingBookIds = singleBookModify ? [singleBookModify] : (selectedBooksModify ? Object.keys(books.selectedBooks) : []);
return modifyingBookIds.filter(_id => _id).map(_id => books.booksHash[_id]);
}
);
const addingSubjectsSelector = createSelector(
[state => state.booksSubjectsModifier.addingSubjects, state => state.subjects.list],
System.import('bundles/bundle/vmPrint').then(printVm => {
this.vmPrint = new printVm(this.list[0]);
});
builder.bundle('what/you/want/built', 'where/to/save', configToUse).then(result => {
//module is built
//result object contains a modules array containing ... the modules in the bundle
});
builder.bundle('what/you/want/built - shared/exclude-this', 'where/to/save', configToUse).then(result => {
});
//or use a wildcard
builder.bundle('what/you/want/built - shared/*', 'where/to/save', configToUse).then(result => {
});
utilityDependencyBundles: [
{ what: 'notes/components/content/clientHealth**/* - ' + notesContentExc, saveTo: 'notes-health-content' },
{ what: 'notes/components/content/clientHealth**/*.htm!text', saveTo: 'notes-health-content-html' },
{ what: 'notes/components/content/client**/* - ' + notesContentExc, saveTo: 'notes-client-content' },
{ what: 'notes/components/content/client**/*.htm!text', saveTo: 'notes-client-content-html' },
{ what: 'notes/components/content/form**/* - ' + notesContentExc, saveTo: 'notes-form-content' },
{ what: 'notes/components/content/form**/*.htm!text', saveTo: 'notes-form-content-html' },
{ what: 'notes/components/content/learn**/* - ' + notesContentExc, saveTo: 'notes-learn-content' },
{ what: 'notes/components/content/learn**/*.htm!text', saveTo: 'notes-learn-content-html' }
],
const namespace = 'contacts.utilities';
function autoNamespace(namespace, object){
Object.keys(object).forEach(k => object[k] = `${namespace}.${object[k]}`);
}
const actions = {
update: 'update'
};
let allSharedUtilities = sharedFilesToBuild.join(' + '),
builds = [
'scan', 'books', 'home', 'authenticate',
{
module: 'reactStartup',
path: '( reactStartup + ' + allSharedUtilities + ' )',
saveTo: '../dist/reactStartup',
exclude: ['react', 'react-bootstrap']
}
];
<script src="https://featuretests.io/rs.js"></script>
<script>
var isEs6 = false;
function webSocketAddress(path){
return 'ws://' + window.location.host + (path || '');
}
var isDev = /localhost:3000/.test(window.location.href);
if (isDev){
loadSystemJs();