{"action":"created","issue":{"url":"https://api.github.com/repos/bem/bem-core/issues/886","labels_url":"https://api.github.com/repos/bem/bem-core/issues/886/labels{/name}","comments_url":"https://api.github.com/repos/bem/bem-core/issues/886/comments","events_url":"https://api.github.com/repos/bem/bem-core/issues/886/events","html_url":"https://github.com/bem/bem-core/issues/886","id":59392628,"number":886,"title":"We need some flag to understand was a block rendered already or not (bemtree)","user":{"login":"apsavin","id":632171,"avatar_url":"https://avatars.githubusercontent.com/u/632171?v=3","gravatar_id":"","url":"https://api.github.com/users/apsavin","html_url":"https://github.com/apsavin","followers_url":"https://api.github.com/users/apsavin/followers","following_url":"https://api.github.com/users/apsavin/following{/other_user}","gists_url":"https://api.github.com/users/apsavin/gists{/gist_id}","starred_url":"https://api.github.com/users/apsavin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apsavin/subscriptions","organizations_url":"https://api.github.com/users/apsavin/orgs","repos_url":"https://api.github.com/users/apsavin/repos","events_url":"https://api.github.com/users/apsavin/events{/privacy}","received_events_url":"https://api.github.com/users/apsavin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-01T11:31:31Z","updated_at":"2015-03-03T14:07:57Z","closed_at":null,"body":"### Steps to reproduce:\r\n\r\n1. Create a project based on project-stub\r\n2. Add `bemtree` technology into the build process\r\n3. Add `desktop.blocks/footer/footer.bemtree` and `desktop.blocks/content/content.bemtree`:\r\n\r\n    ```js\r\n    block('content')(\r\n        content()(function () {\r\n            console.log('content bemtree template called');\r\n            return 'bla';\r\n        })\r\n    );\r\n    \r\n    block('footer')(\r\n        content()(function () {\r\n            var contentBlock = applyCtx({\r\n                block: 'content'\r\n            });\r\n            return [\r\n                contentBlock,\r\n                'asdasd'\r\n            ];\r\n        })\r\n    );\r\n\r\n    ```\r\n4. Add `desktop.bundles/index/index.node.js`\r\n    ```js\r\n    Vow = require('../../libs/bem-core/common.blocks/vow/vow.vanilla.js');\r\n    var BEMTREE = require('./index.bemtree.js').BEMTREE;\r\n    \r\n    BEMTREE.apply({\r\n        block: 'footer'\r\n    }).then(function (res) {\r\n        console.log(res);\r\n    });\r\n    ```\r\n5. `bem make` and run `node desktop.bundles/index/index.node.js`\r\n\r\n### Actual result:\r\ncontent template called twice:\r\n```js\r\ncontent bemtree template called\r\ncontent bemtree template called\r\n{ block: 'footer',\r\n  mods: {},\r\n  content: [ { block: 'content', mods: {}, content: 'bla' }, 'asdasd' ] }\r\n```\r\n\r\n### Expected result:\r\ncontent template called once:\r\n```js\r\ncontent bemtree template called\r\n{ block: 'footer',\r\n  mods: {},\r\n  content: [ { block: 'content', mods: {}, content: 'bla' }, 'asdasd' ] }\r\n```"},"comment":{"url":"https://api.github.com/repos/bem/bem-core/issues/comments/76951007","html_url":"https://github.com/bem/bem-core/issues/886#issuecomment-76951007","issue_url":"https://api.github.com/repos/bem/bem-core/issues/886","id":76951007,"user":{"login":"veged","id":15365,"avatar_url":"https://avatars.githubusercontent.com/u/15365?v=3","gravatar_id":"","url":"https://api.github.com/users/veged","html_url":"https://github.com/veged","followers_url":"https://api.github.com/users/veged/followers","following_url":"https://api.github.com/users/veged/following{/other_user}","gists_url":"https://api.github.com/users/veged/gists{/gist_id}","starred_url":"https://api.github.com/users/veged/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/veged/subscriptions","organizations_url":"https://api.github.com/users/veged/orgs","repos_url":"https://api.github.com/users/veged/repos","events_url":"https://api.github.com/users/veged/events{/privacy}","received_events_url":"https://api.github.com/users/veged/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T14:07:57Z","updated_at":"2015-03-03T14:07:57Z","body":"@apsavin looks like completely logical behaviour since you call applying twice (directly and indirectly) — can you provide any PR with possible ways to handle it?"}}