title: reorderArray for Firebase Array in Ionic
body: <p>I have an app where people track their orders, and each user can create their own statuses that their orders need to be in.</p>
  
  <p>For example, when a user registers, they's make statuses such as "Processing", "Payment Received" and "Shipped" and it is represented in a list.</p>
  
  <p>I am trying to have the ability to reorder these statuses that are stored in a Firebase database.</p>
  
  <p>I have used reorderArray, which works, but then when i go out and back in again, the list is back to what it was previously.</p>
  
  <p>See code below:</p>
  
  <p>order-statuses.ts</p>
  
  <pre><code>this.authUser = this.auth.getLoggedInUser();
      if (this.authUser) {
        this.db.list('/users/' + this.authUser.uid + 
  '/OrderStatuses/').subscribe(items =&gt; {
          this.orderStatuses = items;
        });
      }   
  
  reorderItems(index){
    this.orderStatuses = reorderArray(this.orderStatuses, index);
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/h9UQu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h9UQu.png" alt="Screenshot of the app"></a></p>
  
  <p><a href="https://i.stack.imgur.com/L4QTG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L4QTG.png" alt="Screenshot of the database structure"></a></p>