SwiftUI - Passing a variable to Observable Object

I have a view that's receiving an ID value from the previous view. I need to also take that ID value and pass it into an ObservableObject so that I can run a Firestore query on that ID. I'm at a loss as to how to grab that ID for my ObservableObject.


import SwiftUI
import Firebase

struct ItemsView: View {
   var itemName: String
   var itemID: String
   @ObservedObject var items = getItemsData()
    // ....etc
    }

class getItemsData() {
   @Published var data = [items]()
   init() {
      let db = Firestore.firestore()
      db.collection("items").whreField("itemID", isEqualTo: "THIS IS WHERE I NEED TO PASS THE VALUE OF itemID").addSnopshotListenser


So in the query call, I need to call the ItemID value to query based on that value that's defined at the top of the view.

Code Block
import SwiftUI
import Firebase
struct ItemsView: View {
var itemName: String
var itemID: String
@ObservedObject var itemsGetter = ItemsGetter()
// ....etc
.onAppear {
itemsGetter.get(itemID:itemID)
}
}
class ItemsGetter {
@Published var data = [items]()
func get(itemID:String) {
let db = Firestore.firestore()
db.collection("items").whreField("itemID", isEqualTo: itemID).addSnopshotListenser

SwiftUI - Passing a variable to Observable Object
 
 
Q