{"action":"created","issue":{"url":"https://api.github.com/repos/riot/riot/issues/1444","labels_url":"https://api.github.com/repos/riot/riot/issues/1444/labels{/name}","comments_url":"https://api.github.com/repos/riot/riot/issues/1444/comments","events_url":"https://api.github.com/repos/riot/riot/issues/1444/events","html_url":"https://github.com/riot/riot/pull/1444","id":122461644,"number":1444,"title":"Inject tag styles in batch","user":{"login":"nippur72","id":2598443,"avatar_url":"https://avatars.githubusercontent.com/u/2598443?v=3","gravatar_id":"","url":"https://api.github.com/users/nippur72","html_url":"https://github.com/nippur72","followers_url":"https://api.github.com/users/nippur72/followers","following_url":"https://api.github.com/users/nippur72/following{/other_user}","gists_url":"https://api.github.com/users/nippur72/gists{/gist_id}","starred_url":"https://api.github.com/users/nippur72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nippur72/subscriptions","organizations_url":"https://api.github.com/users/nippur72/orgs","repos_url":"https://api.github.com/users/nippur72/repos","events_url":"https://api.github.com/users/nippur72/events{/privacy}","received_events_url":"https://api.github.com/users/nippur72/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-16T09:25:52Z","updated_at":"2015-12-17T09:08:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/riot/riot/pulls/1444","html_url":"https://github.com/riot/riot/pull/1444","diff_url":"https://github.com/riot/riot/pull/1444.diff","patch_url":"https://github.com/riot/riot/pull/1444.patch"},"body":"This PR allows tag styles to be mounted in batches, rather than one by one (see #1439).\r\n\r\n`injectStyles` is now replaced with `tagStyles`. \r\n\r\n* When defining a tag with `riot.tag()`, `tagStyles.add(css)` is used to accumulated styles into the batch.\r\n* When mounting tags with `riot.mount()`, `tagStyles.inject()` is used to inject the accumulated styles into the DOM and the batch is cleared.\r\n\r\nI have assumed that `riot.mount()` is the right place/time when to inject styles. \r\n\r\nThe only thing that isn't clear to me is why the old code checked for `injectStyles` to be defined:\r\n```\r\nelse if (injectStyles) injectStyles(css)\r\n```\r\n```\r\nif (css && injectStyles) injectStyles(css)\r\n```\r\nI have maintained the check, but I guess it's superfluous?\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/riot/riot/issues/comments/165389559","html_url":"https://github.com/riot/riot/pull/1444#issuecomment-165389559","issue_url":"https://api.github.com/repos/riot/riot/issues/1444","id":165389559,"user":{"login":"nippur72","id":2598443,"avatar_url":"https://avatars.githubusercontent.com/u/2598443?v=3","gravatar_id":"","url":"https://api.github.com/users/nippur72","html_url":"https://github.com/nippur72","followers_url":"https://api.github.com/users/nippur72/followers","following_url":"https://api.github.com/users/nippur72/following{/other_user}","gists_url":"https://api.github.com/users/nippur72/gists{/gist_id}","starred_url":"https://api.github.com/users/nippur72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nippur72/subscriptions","organizations_url":"https://api.github.com/users/nippur72/orgs","repos_url":"https://api.github.com/users/nippur72/repos","events_url":"https://api.github.com/users/nippur72/events{/privacy}","received_events_url":"https://api.github.com/users/nippur72/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T09:08:29Z","updated_at":"2015-12-17T09:08:29Z","body":"@aMarCruz I renamed `injectStyle` into `tagStyles` turning it from a function to a complex object, so there's no need to keep the old `injectStyle` as it's not used anywhere. "}}