Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderedCallback() {
// Performs this operation only on first render
if (this.fullCalendarJsInitialised) {
return;
}
this.fullCalendarJsInitialised = true;
// Executes all loadScript and loadStyle promises
// and only resolves them once all promises are done
Promise.all([
loadScript(this, FullCalendarJS + '/jquery.min.js'),
loadScript(this, FullCalendarJS + '/moment.min.js'),
loadScript(this, FullCalendarJS + '/fullcalendar.min.js'),
loadStyle(this, FullCalendarJS + '/fullcalendar.min.css'),
// loadStyle(this, FullCalendarJS + '/fullcalendar.print.min.css')
])
.then(() => {
// Initialise the calendar configuration
this.initialiseFullCalendarJs();
})
.catch(error => {
// eslint-disable-next-line no-console
console.error({
message: 'Error occured on FullCalendarJS',
error
});
})
}
secondary,
} = this;
if (secondary) {
try {
await poll(() => (window.reduxStores && window.reduxStores[this.storeName]));
this.resourceLoaded = true;
return;
} catch (ex) {
console.log(ex);
return;
}
}
await Promise.all([
loadScript(this, reduxResourceURL),
loadScript(this, reduxThunkResourceURL),
loadScript(this, lodashResourceURL),
]);
const {
createStore,
applyMiddleware,
combineReducers
} = window.Redux;
const ReduxThunk = window.ReduxThunk.default;
const logger = createLoggerMiddleware(storeName);
const rootReducer = useCombineReducers ? combineReducers(reducers) : reducers;
let enhancer;
if (useThunk && useLogger) {
} = this;
if (secondary) {
try {
await poll(() => (window.reduxStores && window.reduxStores[this.storeName]));
this.resourceLoaded = true;
return;
} catch (ex) {
console.log(ex);
return;
}
}
await Promise.all([
loadScript(this, reduxResourceURL),
loadScript(this, reduxThunkResourceURL),
loadScript(this, lodashResourceURL),
]);
const {
createStore,
applyMiddleware,
combineReducers
} = window.Redux;
const ReduxThunk = window.ReduxThunk.default;
const logger = createLoggerMiddleware(storeName);
const rootReducer = useCombineReducers ? combineReducers(reducers) : reducers;
let enhancer;
if (useThunk && useLogger) {
enhancer = applyMiddleware(ReduxThunk, logger)
if (secondary) {
try {
await poll(() => (window.reduxStores && window.reduxStores[this.storeName]));
this.resourceLoaded = true;
return;
} catch (ex) {
console.log(ex);
return;
}
}
await Promise.all([
loadScript(this, reduxResourceURL),
loadScript(this, reduxThunkResourceURL),
loadScript(this, lodashResourceURL),
]);
const {
createStore,
applyMiddleware,
combineReducers
} = window.Redux;
const ReduxThunk = window.ReduxThunk.default;
const logger = createLoggerMiddleware(storeName);
const rootReducer = useCombineReducers ? combineReducers(reducers) : reducers;
let enhancer;
if (useThunk && useLogger) {
enhancer = applyMiddleware(ReduxThunk, logger)
} else if (useThunk) {
loadCometdScript(){
if( !this.subscription ){
Promise.all([
loadScript(this, cometdStaticResource + '/cometd.js')
])
.then(() => {
this.loadSessionId();
})
.catch(error => {
let message = error.message || error.body.message;
this.fireErrorEvent(message);
});
}
else{
this.fireErrorEvent('Subscription already exists.');
this.consoleLog('(LWC Streaming API) Error: Subscription already exists.');
}
}