title: How to manage @ObservedObject and @EnvironmentObject on same Struct?
body: <p>When <code>EnvironmentObject</code> is update at same time <code>ObservedObject</code> is initialized again. So, <code>Name</code> value is blank every time when <code>@EnvironmentObject</code> updates.</p>
  <pre class="lang-swift prettyprint-override"><code>struct MenuView: View {
      @EnvironmentObject var order: Order
      @ObservedObject var model = DetailsModel()
      var body: some View {
          NavigationView {
              VStack {
                  Text(&quot;Name: \(self.model.name)&quot;)
  
                  Button(action:{
                      self.model.name = &quot;Arjun&quot;
                  }) {
                      Text(&quot;Set Name&quot;)
                  }.padding(.bottom, 30.0)
                  
                  Button(action:{
                      self.order.add(item: &quot;item&quot;)
                  }) {
                      Image(systemName: &quot;cart.badge.plus&quot;)
                      Text(&quot;Add to cart&quot;)
                  }.padding(.bottom, 30.0)
              }
          }
      }
  }
  
  // DetailsModel
  class DetailsModel: ObservableObject {
      
      @Published var name:String = &quot;&quot;
  
  }
  </code></pre>
  <p>My question is How to mange <code>@ObservedObject</code> value once <code>@EnvironmentObject</code> updates?</p>