This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bookSubjectManagerInitialState = () => ({ | |
singleBookModify: null, | |
selectedBooksModify: false, | |
addingSubjects: {}, | |
removingSubjects: {} | |
}); | |
function bookSubjectManagerReducer(state = bookSubjectManagerInitialState(), action = {}){ | |
switch (action.type){ | |
case ENABLE_SUBJECT_MODIFICATION_FOR_SINGLE_BOOK: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.import('bundles/bundle/vmPrint').then(printVm => { | |
this.vmPrint = new printVm(this.list[0]); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 => { | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' } | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const namespace = 'contacts.utilities'; | |
function autoNamespace(namespace, object){ | |
Object.keys(object).forEach(k => object[k] = `${namespace}.${object[k]}`); | |
} | |
const actions = { | |
update: 'update' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let allSharedUtilities = sharedFilesToBuild.join(' + '), | |
builds = [ | |
'scan', 'books', 'home', 'authenticate', | |
{ | |
module: 'reactStartup', | |
path: '( reactStartup + ' + allSharedUtilities + ' )', | |
saveTo: '../dist/reactStartup', | |
exclude: ['react', 'react-bootstrap'] | |
} | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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(); |