UNPKG

dg-npm-templates

Version:

Npx generator for react app dependency creation by digite

34 lines (27 loc) 742 B
import { createSlice } from '@reduxjs/toolkit'; export const AppSlice = createSlice({ name: 'appData', initialState: {}, reducers: { initAppComp: (state, action) => { state.appData = { showMask: false, initialConfig: { 'welcomeMsg' : 'Welcome to React micro frontend' } } }, showLoading: (state, action) => { state.appData = Object.assign({}, state.appData, { showMask: true }) }, hideLoading: (state, action) => { state.appData = Object.assign({}, state.appData, { showMask: false }) }, } }); export const { initAppComp, showLoading, hideLoading } = AppSlice.actions; export default AppSlice.reducer;