nl_tokens: Add a layer to the state . @param { Object } state Current state . @param { Object } action Action to handle .
pl_tokens: function addLayer ( state , action ) { // TODO: Maybe decide on what a "default case" is in //       order to support easier dev. const new_layer = Object . assign ( { paint : { } , <mask> : { } , } , action . layerDef ) ; // add a layer name if specified in the action. if ( action . layerTitle ) { new_layer . metadata [ TITLE_KEY ] = action . layerTitle ; } return placeLayer ( state , new_layer , action . positionId ) ; }