Skip to content

Conversation

nmalevanec
Copy link
Contributor

@nmalevanec nmalevanec commented Dec 20, 2018

Original Pull Request

magento/magento2#18541

Until now, when a viewModel is set to a block via the layout xml, a new instance is created. But by default, all dependencies of a class are a single instance which is shared.

Description

The purpose of this PR is to allows developers to choose if a view model must be shared or not. By default all view models are shared in order to increase performance (data only needs to be loaded once).

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@ishakhsuvarov
Copy link
Contributor

Closing for now, can be reopened if it's needed.

@ishakhsuvarov ishakhsuvarov deleted the 18541 branch December 5, 2019 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants