Quantcast
Viewing all articles
Browse latest Browse all 4827

How do you deal with large, deeply nested objects in Mirage?

@GregWeb wrote:

Every example I’ve seen for mirage (and I just spent half an hour clicking through every repo I found using Mirage) uses a simple flat structure their factories…

But I have an account factory that looks like this:

//factories/account.js

account {
  /*..dozens 
  of other 
  key values
  ...
  */
  settings: {..},

  integrations: {
    googleAnalytics: {..}
    webhooks: {
      state: {
        url: "example.com"
        status: "active"
      }
    }
  }
}

When I fill out webhook info and submit I just need the updated webhook values to be returned from the post route.

How do I achieve this?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4827

Trending Articles