Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

update reducer

case 'SOME_ACTION':
return {
   ...state,
   contents: state.contents.map(
      (content, i) => i === 1 ? {
         ...content,
         text: action.payload
      } :
      content
   )
}
Source by pretagteam.com #
 
PREVIOUS NEXT
Tagged: #update #reducer
ADD COMMENT
Topic
Name
6+2 =