{"action":"closed","number":3701,"pull_request":{"url":"https://api.github.com/repos/storybooks/storybook/pulls/3701","id":192273155,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjczMTU1","html_url":"https://github.com/storybooks/storybook/pull/3701","diff_url":"https://github.com/storybooks/storybook/pull/3701.diff","patch_url":"https://github.com/storybooks/storybook/pull/3701.patch","issue_url":"https://api.github.com/repos/storybooks/storybook/issues/3701","number":3701,"state":"closed","locked":false,"title":"An update function for knobs to complete the data binding cycle","user":{"login":"aherriot","id":987971,"node_id":"MDQ6VXNlcjk4Nzk3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/987971?v=4","gravatar_id":"","url":"https://api.github.com/users/aherriot","html_url":"https://github.com/aherriot","followers_url":"https://api.github.com/users/aherriot/followers","following_url":"https://api.github.com/users/aherriot/following{/other_user}","gists_url":"https://api.github.com/users/aherriot/gists{/gist_id}","starred_url":"https://api.github.com/users/aherriot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aherriot/subscriptions","organizations_url":"https://api.github.com/users/aherriot/orgs","repos_url":"https://api.github.com/users/aherriot/repos","events_url":"https://api.github.com/users/aherriot/events{/privacy}","received_events_url":"https://api.github.com/users/aherriot/received_events","type":"User","site_admin":false},"body":"Issue: I wish I could interact with the components in the storybook and see the knob values update in response. This PR demonstrates how to do that.\r\n## What I did\r\nSee in this excerpt how the onChange function on the TextField can call a new storybook/knobs function to `update` the values in the knob store.\r\n\r\n```JavaScript\r\nimport React from 'react'\r\n\r\nimport { storiesOf } from '@storybook/react'\r\nimport { action } from '@storybook/addon-actions'\r\nimport { linkTo } from '@storybook/addon-links'\r\nimport { withKnobs, text, update } from '@storybook/addon-knobs'\r\n\r\nimport TextField from './'\r\n\r\nconst stories = storiesOf('TextField', module)\r\nstories.addDecorator(withKnobs)\r\n\r\nstories.add('Controlled', () => {\r\n  const label = text('label', 'label')\r\n  const value = text('value', 'default value')\r\n  return (\r\n    <TextField\r\n      label={label}\r\n      value={value}\r\n      onChange={(event) => {\r\n        update('value', event.target.value)\r\n        action('onChange')(event)\r\n      }}\r\n      onFocus={action('onFocus')}\r\n      onBlur={action('onBlur')}\r\n    />\r\n  )\r\n})\r\n```\r\n\r\n## How to test\r\nI would need to update all the different types of knobs, add documentation and testing for this to be complete, but before I did, I wanted to gage the community interest. Does any one else feel like this is an idea worth pursuing?\r\n","created_at":"2018-06-03T23:17:09Z","updated_at":"2018-06-23T00:15:47Z","closed_at":"2018-06-23T00:15:47Z","merged_at":null,"merge_commit_sha":"4683921121be3767c75f822d8b072268cfe87e3d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"theinterned","id":2694,"node_id":"MDQ6VXNlcjI2OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2694?v=4","gravatar_id":"","url":"https://api.github.com/users/theinterned","html_url":"https://github.com/theinterned","followers_url":"https://api.github.com/users/theinterned/followers","following_url":"https://api.github.com/users/theinterned/following{/other_user}","gists_url":"https://api.github.com/users/theinterned/gists{/gist_id}","starred_url":"https://api.github.com/users/theinterned/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theinterned/subscriptions","organizations_url":"https://api.github.com/users/theinterned/orgs","repos_url":"https://api.github.com/users/theinterned/repos","events_url":"https://api.github.com/users/theinterned/events{/privacy}","received_events_url":"https://api.github.com/users/theinterned/received_events","type":"User","site_admin":false},{"login":"alterx","id":1593752,"node_id":"MDQ6VXNlcjE1OTM3NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1593752?v=4","gravatar_id":"","url":"https://api.github.com/users/alterx","html_url":"https://github.com/alterx","followers_url":"https://api.github.com/users/alterx/followers","following_url":"https://api.github.com/users/alterx/following{/other_user}","gists_url":"https://api.github.com/users/alterx/gists{/gist_id}","starred_url":"https://api.github.com/users/alterx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alterx/subscriptions","organizations_url":"https://api.github.com/users/alterx/orgs","repos_url":"https://api.github.com/users/alterx/repos","events_url":"https://api.github.com/users/alterx/events{/privacy}","received_events_url":"https://api.github.com/users/alterx/received_events","type":"User","site_admin":false},{"login":"leonrodenburg","id":1955709,"node_id":"MDQ6VXNlcjE5NTU3MDk=","avatar_url":"https://avatars1.githubusercontent.com/u/1955709?v=4","gravatar_id":"","url":"https://api.github.com/users/leonrodenburg","html_url":"https://github.com/leonrodenburg","followers_url":"https://api.github.com/users/leonrodenburg/followers","following_url":"https://api.github.com/users/leonrodenburg/following{/other_user}","gists_url":"https://api.github.com/users/leonrodenburg/gists{/gist_id}","starred_url":"https://api.github.com/users/leonrodenburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonrodenburg/subscriptions","organizations_url":"https://api.github.com/users/leonrodenburg/orgs","repos_url":"https://api.github.com/users/leonrodenburg/repos","events_url":"https://api.github.com/users/leonrodenburg/events{/privacy}","received_events_url":"https://api.github.com/users/leonrodenburg/received_events","type":"User","site_admin":false},{"login":"alexandrebodin","id":6065744,"node_id":"MDQ6VXNlcjYwNjU3NDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6065744?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandrebodin","html_url":"https://github.com/alexandrebodin","followers_url":"https://api.github.com/users/alexandrebodin/followers","following_url":"https://api.github.com/users/alexandrebodin/following{/other_user}","gists_url":"https://api.github.com/users/alexandrebodin/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrebodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrebodin/subscriptions","organizations_url":"https://api.github.com/users/alexandrebodin/orgs","repos_url":"https://api.github.com/users/alexandrebodin/repos","events_url":"https://api.github.com/users/alexandrebodin/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrebodin/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":584803996,"node_id":"MDU6TGFiZWw1ODQ4MDM5OTY=","url":"https://api.github.com/repos/storybooks/storybook/labels/addon:%20knobs","name":"addon: knobs","color":"fbca04","default":false},{"id":343576456,"node_id":"MDU6TGFiZWwzNDM1NzY0NTY=","url":"https://api.github.com/repos/storybooks/storybook/labels/feature%20request","name":"feature request","color":"9B58D8","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/storybooks/storybook/pulls/3701/commits","review_comments_url":"https://api.github.com/repos/storybooks/storybook/pulls/3701/comments","review_comment_url":"https://api.github.com/repos/storybooks/storybook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/storybooks/storybook/issues/3701/comments","statuses_url":"https://api.github.com/repos/storybooks/storybook/statuses/0112490adb8363d2733529debac06733d23eb320","head":{"label":"aherriot:master","ref":"master","sha":"0112490adb8363d2733529debac06733d23eb320","user":{"login":"aherriot","id":987971,"node_id":"MDQ6VXNlcjk4Nzk3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/987971?v=4","gravatar_id":"","url":"https://api.github.com/users/aherriot","html_url":"https://github.com/aherriot","followers_url":"https://api.github.com/users/aherriot/followers","following_url":"https://api.github.com/users/aherriot/following{/other_user}","gists_url":"https://api.github.com/users/aherriot/gists{/gist_id}","starred_url":"https://api.github.com/users/aherriot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aherriot/subscriptions","organizations_url":"https://api.github.com/users/aherriot/orgs","repos_url":"https://api.github.com/users/aherriot/repos","events_url":"https://api.github.com/users/aherriot/events{/privacy}","received_events_url":"https://api.github.com/users/aherriot/received_events","type":"User","site_admin":false},"repo":{"id":135713646,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU3MTM2NDY=","name":"storybook","full_name":"aherriot/storybook","owner":{"login":"aherriot","id":987971,"node_id":"MDQ6VXNlcjk4Nzk3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/987971?v=4","gravatar_id":"","url":"https://api.github.com/users/aherriot","html_url":"https://github.com/aherriot","followers_url":"https://api.github.com/users/aherriot/followers","following_url":"https://api.github.com/users/aherriot/following{/other_user}","gists_url":"https://api.github.com/users/aherriot/gists{/gist_id}","starred_url":"https://api.github.com/users/aherriot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aherriot/subscriptions","organizations_url":"https://api.github.com/users/aherriot/orgs","repos_url":"https://api.github.com/users/aherriot/repos","events_url":"https://api.github.com/users/aherriot/events{/privacy}","received_events_url":"https://api.github.com/users/aherriot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aherriot/storybook","description":"Interactive UI component dev & test: React, React Native, Vue, Angular","fork":true,"url":"https://api.github.com/repos/aherriot/storybook","forks_url":"https://api.github.com/repos/aherriot/storybook/forks","keys_url":"https://api.github.com/repos/aherriot/storybook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aherriot/storybook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aherriot/storybook/teams","hooks_url":"https://api.github.com/repos/aherriot/storybook/hooks","issue_events_url":"https://api.github.com/repos/aherriot/storybook/issues/events{/number}","events_url":"https://api.github.com/repos/aherriot/storybook/events","assignees_url":"https://api.github.com/repos/aherriot/storybook/assignees{/user}","branches_url":"https://api.github.com/repos/aherriot/storybook/branches{/branch}","tags_url":"https://api.github.com/repos/aherriot/storybook/tags","blobs_url":"https://api.github.com/repos/aherriot/storybook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aherriot/storybook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aherriot/storybook/git/refs{/sha}","trees_url":"https://api.github.com/repos/aherriot/storybook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aherriot/storybook/statuses/{sha}","languages_url":"https://api.github.com/repos/aherriot/storybook/languages","stargazers_url":"https://api.github.com/repos/aherriot/storybook/stargazers","contributors_url":"https://api.github.com/repos/aherriot/storybook/contributors","subscribers_url":"https://api.github.com/repos/aherriot/storybook/subscribers","subscription_url":"https://api.github.com/repos/aherriot/storybook/subscription","commits_url":"https://api.github.com/repos/aherriot/storybook/commits{/sha}","git_commits_url":"https://api.github.com/repos/aherriot/storybook/git/commits{/sha}","comments_url":"https://api.github.com/repos/aherriot/storybook/comments{/number}","issue_comment_url":"https://api.github.com/repos/aherriot/storybook/issues/comments{/number}","contents_url":"https://api.github.com/repos/aherriot/storybook/contents/{+path}","compare_url":"https://api.github.com/repos/aherriot/storybook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aherriot/storybook/merges","archive_url":"https://api.github.com/repos/aherriot/storybook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aherriot/storybook/downloads","issues_url":"https://api.github.com/repos/aherriot/storybook/issues{/number}","pulls_url":"https://api.github.com/repos/aherriot/storybook/pulls{/number}","milestones_url":"https://api.github.com/repos/aherriot/storybook/milestones{/number}","notifications_url":"https://api.github.com/repos/aherriot/storybook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aherriot/storybook/labels{/name}","releases_url":"https://api.github.com/repos/aherriot/storybook/releases{/id}","deployments_url":"https://api.github.com/repos/aherriot/storybook/deployments","created_at":"2018-06-01T12:13:59Z","updated_at":"2018-06-03T23:08:45Z","pushed_at":"2018-06-03T23:08:43Z","git_url":"git://github.com/aherriot/storybook.git","ssh_url":"git@github.com:aherriot/storybook.git","clone_url":"https://github.com/aherriot/storybook.git","svn_url":"https://github.com/aherriot/storybook","homepage":"https://storybook.js.org","size":103359,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"storybooks:master","ref":"master","sha":"407cc6735596daa42d1f64e95b17a92eec585dbc","user":{"login":"storybooks","id":22632046,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNjMyMDQ2","avatar_url":"https://avatars3.githubusercontent.com/u/22632046?v=4","gravatar_id":"","url":"https://api.github.com/users/storybooks","html_url":"https://github.com/storybooks","followers_url":"https://api.github.com/users/storybooks/followers","following_url":"https://api.github.com/users/storybooks/following{/other_user}","gists_url":"https://api.github.com/users/storybooks/gists{/gist_id}","starred_url":"https://api.github.com/users/storybooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storybooks/subscriptions","organizations_url":"https://api.github.com/users/storybooks/orgs","repos_url":"https://api.github.com/users/storybooks/repos","events_url":"https://api.github.com/users/storybooks/events{/privacy}","received_events_url":"https://api.github.com/users/storybooks/received_events","type":"Organization","site_admin":false},"repo":{"id":54173593,"node_id":"MDEwOlJlcG9zaXRvcnk1NDE3MzU5Mw==","name":"storybook","full_name":"storybooks/storybook","owner":{"login":"storybooks","id":22632046,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNjMyMDQ2","avatar_url":"https://avatars3.githubusercontent.com/u/22632046?v=4","gravatar_id":"","url":"https://api.github.com/users/storybooks","html_url":"https://github.com/storybooks","followers_url":"https://api.github.com/users/storybooks/followers","following_url":"https://api.github.com/users/storybooks/following{/other_user}","gists_url":"https://api.github.com/users/storybooks/gists{/gist_id}","starred_url":"https://api.github.com/users/storybooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storybooks/subscriptions","organizations_url":"https://api.github.com/users/storybooks/orgs","repos_url":"https://api.github.com/users/storybooks/repos","events_url":"https://api.github.com/users/storybooks/events{/privacy}","received_events_url":"https://api.github.com/users/storybooks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/storybooks/storybook","description":"Interactive UI component dev & test: React, React Native, Vue, Angular","fork":false,"url":"https://api.github.com/repos/storybooks/storybook","forks_url":"https://api.github.com/repos/storybooks/storybook/forks","keys_url":"https://api.github.com/repos/storybooks/storybook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/storybooks/storybook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/storybooks/storybook/teams","hooks_url":"https://api.github.com/repos/storybooks/storybook/hooks","issue_events_url":"https://api.github.com/repos/storybooks/storybook/issues/events{/number}","events_url":"https://api.github.com/repos/storybooks/storybook/events","assignees_url":"https://api.github.com/repos/storybooks/storybook/assignees{/user}","branches_url":"https://api.github.com/repos/storybooks/storybook/branches{/branch}","tags_url":"https://api.github.com/repos/storybooks/storybook/tags","blobs_url":"https://api.github.com/repos/storybooks/storybook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/storybooks/storybook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/storybooks/storybook/git/refs{/sha}","trees_url":"https://api.github.com/repos/storybooks/storybook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/storybooks/storybook/statuses/{sha}","languages_url":"https://api.github.com/repos/storybooks/storybook/languages","stargazers_url":"https://api.github.com/repos/storybooks/storybook/stargazers","contributors_url":"https://api.github.com/repos/storybooks/storybook/contributors","subscribers_url":"https://api.github.com/repos/storybooks/storybook/subscribers","subscription_url":"https://api.github.com/repos/storybooks/storybook/subscription","commits_url":"https://api.github.com/repos/storybooks/storybook/commits{/sha}","git_commits_url":"https://api.github.com/repos/storybooks/storybook/git/commits{/sha}","comments_url":"https://api.github.com/repos/storybooks/storybook/comments{/number}","issue_comment_url":"https://api.github.com/repos/storybooks/storybook/issues/comments{/number}","contents_url":"https://api.github.com/repos/storybooks/storybook/contents/{+path}","compare_url":"https://api.github.com/repos/storybooks/storybook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/storybooks/storybook/merges","archive_url":"https://api.github.com/repos/storybooks/storybook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/storybooks/storybook/downloads","issues_url":"https://api.github.com/repos/storybooks/storybook/issues{/number}","pulls_url":"https://api.github.com/repos/storybooks/storybook/pulls{/number}","milestones_url":"https://api.github.com/repos/storybooks/storybook/milestones{/number}","notifications_url":"https://api.github.com/repos/storybooks/storybook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/storybooks/storybook/labels{/name}","releases_url":"https://api.github.com/repos/storybooks/storybook/releases{/id}","deployments_url":"https://api.github.com/repos/storybooks/storybook/deployments","created_at":"2016-03-18T04:23:44Z","updated_at":"2018-06-23T00:01:11Z","pushed_at":"2018-06-22T17:33:09Z","git_url":"git://github.com/storybooks/storybook.git","ssh_url":"git@github.com:storybooks/storybook.git","clone_url":"https://github.com/storybooks/storybook.git","svn_url":"https://github.com/storybooks/storybook","homepage":"https://storybook.js.org","size":106550,"stargazers_count":25145,"watchers_count":25145,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1741,"mirror_url":null,"archived":false,"open_issues_count":158,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1741,"open_issues":158,"watchers":25145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/storybooks/storybook/pulls/3701"},"html":{"href":"https://github.com/storybooks/storybook/pull/3701"},"issue":{"href":"https://api.github.com/repos/storybooks/storybook/issues/3701"},"comments":{"href":"https://api.github.com/repos/storybooks/storybook/issues/3701/comments"},"review_comments":{"href":"https://api.github.com/repos/storybooks/storybook/pulls/3701/comments"},"review_comment":{"href":"https://api.github.com/repos/storybooks/storybook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/storybooks/storybook/pulls/3701/commits"},"statuses":{"href":"https://api.github.com/repos/storybooks/storybook/statuses/0112490adb8363d2733529debac06733d23eb320"}},"author_association":"NONE","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"unstable","merged_by":null,"comments":3,"review_comments":6,"maintainer_can_modify":false,"commits":1,"additions":30,"deletions":16,"changed_files":6}}
{"actor":{"display_login":"Keraito"}}