concept default in category react
appears as: default, default

This is an excerpt from Manning's book React in Action.
Service workers included by default (a worker-style approach to executing JavaScript)
Listing 11.2. Setting up the loading reducer (src/reducers/loading.js)
import initialState from '../constants/initialState'; import * as types from '../constants/types'; export function loading(state = initialState.loading, action) { #1 switch (action.type) { #2 case types.app.LOADING: #3 return true; #3 case types.app.LOADED: #4 return false; default: #5 return state; }} #1 Function that takes two parameters, state and an action #2 Usually, you’ll use a switch statement to explicitly handle each type of action and return state by default. #3 If action has loading type, return true for new state value #4 Handle loaded case and return appropriate false case #5 Return existing state by default !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":3,\"ch\":66},{\"line\":3,\"ch\":68}],[{\"line\":13,\"ch\":0},{\"line\":13,\"ch\":2}],[{\"line\":4,\"ch\":66},{\"line\":4,\"ch\":68}],[{\"line\":14,\"ch\":0},{\"line\":14,\"ch\":2}],[{\"line\":5,\"ch\":66},{\"line\":5,\"ch\":68}],[{\"line\":6,\"ch\":66},{\"line\":6,\"ch\":68}],[{\"line\":15,\"ch\":0},{\"line\":15,\"ch\":2}],[{\"line\":5,\"ch\":66},{\"line\":5,\"ch\":68}],[{\"line\":6,\"ch\":66},{\"line\":6,\"ch\":68}],[{\"line\":15,\"ch\":0},{\"line\":15,\"ch\":2}],[{\"line\":7,\"ch\":66},{\"line\":7,\"ch\":68}],[{\"line\":16,\"ch\":0},{\"line\":16,\"ch\":2}],[{\"line\":9,\"ch\":66},{\"line\":9,\"ch\":68}],[{\"line\":17,\"ch\":0},{\"line\":17,\"ch\":2}]]"} !@%STYLE%@!