title: Can't add data fetched from Firebase to new Array
body: <p>I'm am fetching data from firebase from 3 different collections. Once I have the data fetched I would like to append the data from the 3 functions to 1 new array so I have all the data stored one place. But once I append it comes out empty like the fetch functions didn't work. I've tested and debugged and the data is there but I can't seem to add the fetched data to a new Array.</p>
  <hr />
  <p>Model</p>
  <pre><code> import Foundation
   import SwiftUI
  
   struct GameModel: Identifiable {
       var id = UUID()
       var title: String
       var descriptionMenu: String
       var imageNameMenu: String
   }
   
  </code></pre>
  <hr />
  <pre><code>Fetch Data Class
  
   import Foundation
   import SwiftUI
   import Firebase
  
   class SearchController: ObservableObject {
  
       @Published var allGames = [GameModel]()
  
       @Published var cardsMenu = [GameModel]()
       @Published var diceMenu = [GameModel]()
       @Published var miscellaneuosMenu = [GameModel]()
  
       private var db = Firestore.firestore()
  
       func fetchCardGamesData() {...}
       func fetchDiceGamesData() {...}   
       func fetchMiscGamesData() {...}
  
       func combineGames() {
      
           for i in cardsMenu {
              allGames.append(i)
           }
      
           for n in diceMenu {
              allGames.append(n)
           }
      
           for x in miscellaneuosMenu {
              allGames.append(x)
           }
       }
   }
  </code></pre>
  <hr />
  <pre><code>Fetch data Functions
  
  func fetchCardGamesData() {
       db.collection(&quot;cardsMenu&quot;).addSnapshotListener { (querySnapshot, error) in
           guard let documents = querySnapshot?.documents else {
              print(&quot;No documents&quot;)
              return
          }
          
          self.cardsMenu = documents.map { (queryDocumentSnapshot) -&gt; GameModel in
              let data = queryDocumentSnapshot.data()
              
              let title = data[&quot;title&quot;] as? String ?? &quot;&quot;
              
              let descriptionMenuRecieved = data[&quot;descriptionMenu&quot;] as? String ?? &quot;&quot;
              let descriptionMenu = descriptionMenuRecieved.replacingOccurrences(of:         &quot;\\n&quot;, with: &quot;\n&quot;)
              
              let imageNameMenu = data[&quot;imageNameMenu&quot;] as? String ?? &quot;&quot;
              
              let allGameInfo = GameModel(title: title, descriptionMenu:         descriptionMenu, imageNameMenu: imageNameMenu)
              
              return allGameInfo
          }
      }
   }
  </code></pre>
  <hr />
  <pre><code>func fetchDiceGamesData() {
      db.collection(&quot;diceMenu&quot;).addSnapshotListener { (querySnapshot, error) in
          guard let documents = querySnapshot?.documents else {
              print(&quot;No documents&quot;)
              return
          }
          
          self.diceMenu = documents.map { (queryDocumentSnapshot) -&gt; GameModel in
              let data = queryDocumentSnapshot.data()
              
              let title = data[&quot;title&quot;] as? String ?? &quot;&quot;
              
              let descriptionMenuRecieved = data[&quot;descriptionMenu&quot;] as? String ?? &quot;&quot;
              let descriptionMenu = descriptionMenuRecieved.replacingOccurrences(of:     &quot;\\n&quot;, with: &quot;\n&quot;)
              
              let imageNameMenu = data[&quot;imageNameMenu&quot;] as? String ?? &quot;&quot;
              
              let allGameInfo = GameModel(title: title, descriptionMenu:     descriptionMenu, imageNameMenu: imageNameMenu)
           
              return allGameInfo
          }
          
      }
   }
  </code></pre>
  <hr />
  <pre><code>     func fetchMiscGamesData() {
      db.collection(&quot;miscellaneuosMenu&quot;).addSnapshotListener { (querySnapshot, error)     in
          guard let documents = querySnapshot?.documents else {
              print(&quot;No documents&quot;)
              return
          }
          
          self.miscellaneuosMenu = documents.map { (queryDocumentSnapshot) -&gt;     GameModel in
              let data = queryDocumentSnapshot.data()
              
              let title = data[&quot;title&quot;] as? String ?? &quot;&quot;
              
              let descriptionMenuRecieved = data[&quot;descriptionMenu&quot;] as? String ?? &quot;&quot;
              let descriptionMenu = descriptionMenuRecieved.replacingOccurrences(of:     &quot;\\n&quot;, with: &quot;\n&quot;)
              
              let imageNameMenu = data[&quot;imageNameMenu&quot;] as? String ?? &quot;&quot;
              
              let miscellaneousGames = GameModel(title: title, descriptionMenu:     descriptionMenu, imageNameMenu: imageNameMenu)
              return miscellaneousGames
          } 
      }
   }
  </code></pre>
  <hr />
  <pre><code>View
  import SwiftUI
   import Foundation
  
   struct SearchView: View {
  
      @ObservedObject var allGames = SearchController()
  
      var body: some View {
      
          NavigationView{
              ZStack(alignment: .top) {
                  GeometryReader{_ in
                      //Text(&quot;Home&quot;)
                  }
                  .background(Color(&quot;Color&quot;).edgesIgnoringSafeArea(.all))
              
                  SearchBar(data: self.$allGames.allGames)
                      .padding(.top)
              }
              .navigationBarTitle(&quot;Search&quot;)
              .padding(.top, -20)
              .onAppear(){
                  self.allGames.fetchCardGamesData()
                  self.allGames.fetchDiceGamesData()
                  self.allGames.fetchMiscGamesData()
                  self.allGames.combineGames()
              }
          }
          .navigationViewStyle(StackNavigationViewStyle())
          .listStyle(PlainListStyle())
      }
   }
  </code></pre>
  <hr />
  <p>SearchBar</p>
  <pre><code>struct SearchBar: View {
  
  @State var txt = &quot;&quot;
  @Binding var data: [GameModel]
  
  var body: some View {
      
      VStack(spacing: 0){
          
          HStack{
              
              TextField(&quot;Search&quot;, text: self.$txt)
              
              if self.txt != &quot;&quot; {
                  
                  Button(action: {
                      
                      self.txt = &quot;&quot;
                      
                  }, label: {
                      Image(systemName: &quot;xmark.circle.fill&quot;)
                  })
                  .foregroundColor(.gray)
              }
          }.padding()
          
          if self.txt != &quot;&quot;{
              
              if self.data.filter({$0.title.lowercased().contains(self.txt.lowercased())}).count == 0 {
                  Text(&quot;No Results Found&quot;)
                      .foregroundColor(Color.black.opacity(0.5))
                      .padding()
              }
              else {
                  
                  List(self.data.filter{$0.title.lowercased().contains(self.txt.lowercased())}){
                      i in
                      
                      NavigationLink(destination: i.view.navigationBarTitleDisplayMode(.inline).onAppear(){
                          // Clear searchfield when return
                          txt = &quot;&quot;
                      }) {
                          Text(i.title)
                      }
                  }
                  .frame(height: UIScreen.main.bounds.height / 3)
                  .padding(.trailing)
              }
          }
      }
      .background(Color.white)
      .cornerRadius(10)
      .padding()
  }
  </code></pre>
  <p>}</p>
  <p>Hope you guys can help me.</p>