Skip to content

Instantly share code, notes, and snippets.

@chrisvfritz

chrisvfritz/.md Secret

Created December 13, 2018 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvfritz/9d031a371985212d49342d2e6cee1907 to your computer and use it in GitHub Desktop.
Save chrisvfritz/9d031a371985212d49342d2e6cee1907 to your computer and use it in GitHub Desktop.

Disadvantages of the state provider pattern

  • It makes the data available in the template/render function only, while state, getters, and actions often need to be accessed in local computed properties and methods. When that's not possible, you either have to duplicate state imports outside the template - or more likely in my experience, people just keep forcing things into the template, resulting in severe bloat.

  • For every state provider, you increase the base indentation of the entire template, so that components accessing a lot of different data become very difficult to work on with smaller screens or in splitscreen.

  • This is one of the few patterns that really requires functional components - but in reality, most people don't feel comfortable writing them. The result is often an orders of magnitude increase in the number of component instances, which I've seen result in serious, but completely non-obvious performance issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment