when needing accumulative data | contextual data #322
-
| 
         Hello, Some time you need to accumulate data. Example: We will have two issues: What do you suggest ?  | 
  
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            RebeccaStevens
          
      
      
        Jan 25, 2022 
      
    
    Replies: 1 comment 1 reply
-
| 
         There are few ways to solve this. Option one is to explicitly mark the array as mutable (usually by prefixing "mutable" to the start of the variables name) and configure the rules to ignore variable marked like this. Option two would be to configure the rules to ignore all local mutations. Option 3 would be to use an eslint-disable comment at the start of the function, and an eslint-enable comment at the end (for the rules being violated).  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
      Answer selected by
        speedfl
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
There are few ways to solve this.
Option one is to explicitly mark the array as mutable (usually by prefixing "mutable" to the start of the variables name) and configure the rules to ignore variable marked like this.
Option two would be to configure the rules to ignore all local mutations.
Option 3 would be to use an eslint-disable comment at the start of the function, and an eslint-enable comment at the end (for the rules being violated).