{"action":"created","issue":{"url":"https://api.github.com/repos/0xfe/vexflow/issues/426","repository_url":"https://api.github.com/repos/0xfe/vexflow","labels_url":"https://api.github.com/repos/0xfe/vexflow/issues/426/labels{/name}","comments_url":"https://api.github.com/repos/0xfe/vexflow/issues/426/comments","events_url":"https://api.github.com/repos/0xfe/vexflow/issues/426/events","html_url":"https://github.com/0xfe/vexflow/pull/426","id":172336644,"number":426,"title":"Extract out builder commit behavior into functions ","user":{"login":"Silverwolf90","id":1631625,"avatar_url":"https://avatars.githubusercontent.com/u/1631625?v=3","gravatar_id":"","url":"https://api.github.com/users/Silverwolf90","html_url":"https://github.com/Silverwolf90","followers_url":"https://api.github.com/users/Silverwolf90/followers","following_url":"https://api.github.com/users/Silverwolf90/following{/other_user}","gists_url":"https://api.github.com/users/Silverwolf90/gists{/gist_id}","starred_url":"https://api.github.com/users/Silverwolf90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Silverwolf90/subscriptions","organizations_url":"https://api.github.com/users/Silverwolf90/orgs","repos_url":"https://api.github.com/users/Silverwolf90/repos","events_url":"https://api.github.com/users/Silverwolf90/events{/privacy}","received_events_url":"https://api.github.com/users/Silverwolf90/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-21T19:28:38Z","updated_at":"2016-08-21T19:43:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/0xfe/vexflow/pulls/426","html_url":"https://github.com/0xfe/vexflow/pull/426","diff_url":"https://github.com/0xfe/vexflow/pull/426.diff","patch_url":"https://github.com/0xfe/vexflow/pull/426.patch"},"body":"WIP - But wanted to get your initial thoughts on this\r\n\r\n---\r\n\r\nThis refactors the `Builder` with a new property: `onCommit`. It's an array of functions which will will be run in sequence and passed `(currentOptions, note, factory)` -- the expected usage is around matching key/values in the `currentOptions` object and then transforming the `note` in some way. The `currentOptions` object is formed by the assigning the piece options into the builder options\r\n\r\nI extracted the `id` setting into its own function. And also implemented articulations in this way:\r\n```\r\nc4/4[articulations='staccato.above,tenuto.below']\r\n```\r\n\r\nMost importantly, this provides the user with a hook for arbitrary extension."},"comment":{"url":"https://api.github.com/repos/0xfe/vexflow/issues/comments/241277347","html_url":"https://github.com/0xfe/vexflow/pull/426#issuecomment-241277347","issue_url":"https://api.github.com/repos/0xfe/vexflow/issues/426","id":241277347,"user":{"login":"0xfe","id":241299,"avatar_url":"https://avatars.githubusercontent.com/u/241299?v=3","gravatar_id":"","url":"https://api.github.com/users/0xfe","html_url":"https://github.com/0xfe","followers_url":"https://api.github.com/users/0xfe/followers","following_url":"https://api.github.com/users/0xfe/following{/other_user}","gists_url":"https://api.github.com/users/0xfe/gists{/gist_id}","starred_url":"https://api.github.com/users/0xfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xfe/subscriptions","organizations_url":"https://api.github.com/users/0xfe/orgs","repos_url":"https://api.github.com/users/0xfe/repos","events_url":"https://api.github.com/users/0xfe/events{/privacy}","received_events_url":"https://api.github.com/users/0xfe/received_events","type":"User","site_admin":false},"created_at":"2016-08-21T19:43:02Z","updated_at":"2016-08-21T19:43:02Z","body":"I like the general idea of customized hooks. How about if these hooks were added by the classes themselves? So `articulations.js` would look something like this:\r\n\r\n```javascript\r\nclass Articulations {\r\n  ...\r\n  static easyScoreOption(currentOptions, note, factory) { ... }\r\n  ...\r\n}\r\n\r\nEasyScore.addNoteOption('articulations', Articulations.easyScoreHook)`\r\n```\r\n\r\nSo when new elements are created, we don't need to modify `easyscore.js`, and keep it free from the potential mess."}}
{"actor":{"display_login":"0xfe"}}