{"action":"created","comment":{"url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/comments/272816106","pull_request_review_id":223563488,"id":272816106,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI3MjgxNjEwNg==","diff_hunk":"@@ -287,6 +287,9 @@ class EmojiInput extends React.PureComponent {\n             return e1.char !== e2.char;\n         });\n \n+        this.filtered = this.props.filterFunctions.length === 0","path":"src/EmojiInput.js","position":4,"original_position":4,"commit_id":"60feb0cd873055a4d9874a378151a963cfc9b912","original_commit_id":"60feb0cd873055a4d9874a378151a963cfc9b912","user":{"login":"rijn","id":6976367,"node_id":"MDQ6VXNlcjY5NzYzNjc=","avatar_url":"https://avatars0.githubusercontent.com/u/6976367?v=4","gravatar_id":"","url":"https://api.github.com/users/rijn","html_url":"https://github.com/rijn","followers_url":"https://api.github.com/users/rijn/followers","following_url":"https://api.github.com/users/rijn/following{/other_user}","gists_url":"https://api.github.com/users/rijn/gists{/gist_id}","starred_url":"https://api.github.com/users/rijn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rijn/subscriptions","organizations_url":"https://api.github.com/users/rijn/orgs","repos_url":"https://api.github.com/users/rijn/repos","events_url":"https://api.github.com/users/rijn/events{/privacy}","received_events_url":"https://api.github.com/users/rijn/received_events","type":"User","site_admin":false},"body":"Let's directly connect the filter functions to lodash chain, e.g.\r\n```js\r\n_(emojis)\r\n  .filter(emoji => _.every ...)\r\n  ...\r\n```\r\n\r\nAlso `_.every` will return true if the first argument is empty array, so it's safe not to check whether the length is zero","created_at":"2019-04-07T03:10:55Z","updated_at":"2019-04-07T03:11:43Z","html_url":"https://github.com/sskhandek/react-native-emoji-input/pull/34#discussion_r272816106","pull_request_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/34","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/comments/272816106"},"html":{"href":"https://github.com/sskhandek/react-native-emoji-input/pull/34#discussion_r272816106"},"pull_request":{"href":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/34","id":268031450,"node_id":"MDExOlB1bGxSZXF1ZXN0MjY4MDMxNDUw","html_url":"https://github.com/sskhandek/react-native-emoji-input/pull/34","diff_url":"https://github.com/sskhandek/react-native-emoji-input/pull/34.diff","patch_url":"https://github.com/sskhandek/react-native-emoji-input/pull/34.patch","issue_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/issues/34","number":34,"state":"open","locked":false,"title":"[Feature] Add filterFunctions prop to enable emojis filtering","user":{"login":"darekg11","id":11317951,"node_id":"MDQ6VXNlcjExMzE3OTUx","avatar_url":"https://avatars2.githubusercontent.com/u/11317951?v=4","gravatar_id":"","url":"https://api.github.com/users/darekg11","html_url":"https://github.com/darekg11","followers_url":"https://api.github.com/users/darekg11/followers","following_url":"https://api.github.com/users/darekg11/following{/other_user}","gists_url":"https://api.github.com/users/darekg11/gists{/gist_id}","starred_url":"https://api.github.com/users/darekg11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darekg11/subscriptions","organizations_url":"https://api.github.com/users/darekg11/orgs","repos_url":"https://api.github.com/users/darekg11/repos","events_url":"https://api.github.com/users/darekg11/events{/privacy}","received_events_url":"https://api.github.com/users/darekg11/received_events","type":"User","site_admin":false},"body":"# Relate to any issue?\r\nhttps://github.com/sskhandek/react-native-emoji-input/issues/5  \r\nIt is a temporary workaround that would allow user of this library to avoid missing emojis being render as `X`\r\n\r\n# Breaking change?\r\nNope, by default all emojis will be rendered as before.\r\n\r\n# What this PR does?  \r\nAdds new `filterFunctions` prop allowing user to pass an array of functions used to filter emojis list before rendering it\r\n\r\n# Example of usage:\r\n```\r\n\tfilterFunctionByUnicode = emoji => {\r\n\t\treturn emoji.lib.added_in === \"6.0\" || emoji.lib.added_in === \"6.1\"\r\n\t}\r\n\r\n\t<EmojiInput\r\n\t\tonEmojiSelected={this.handleEmojiSelected}\r\n\t\tref={emojiInput => this._emojiInput = emojiInput}\r\n\t\tresetSearch={this.state.reset}\r\n\t\tloggingFunction={this.verboseLoggingFunction.bind(this)}\r\n\t\tverboseLoggingFunction={true}\r\n\t\tfilterFunctions={[this.filterFunctionByUnicode]}\r\n\t/>\r\n```\r\n\r\n# Change Preview:  \r\n**Before on my Huawei P8Lite running Android 6.0**:  \r\n![before](https://user-images.githubusercontent.com/11317951/53982863-41c49900-4116-11e9-985b-83044d0ded04.png)\r\n\r\n**After enabling only 6.0 Unicode**:  \r\n![after](https://user-images.githubusercontent.com/11317951/53982900-543ed280-4116-11e9-9ade-6363a4858b03.png)\r\n","created_at":"2019-04-06T12:02:33Z","updated_at":"2019-04-07T03:11:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c42264d3245f47f4eb6fb725fbd1db8107a3f55b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/34/commits","review_comments_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/34/comments","review_comment_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/issues/34/comments","statuses_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/statuses/60feb0cd873055a4d9874a378151a963cfc9b912","head":{"label":"darekg11:feature/allow-to-filter-rendered-emojis","ref":"feature/allow-to-filter-rendered-emojis","sha":"60feb0cd873055a4d9874a378151a963cfc9b912","user":{"login":"darekg11","id":11317951,"node_id":"MDQ6VXNlcjExMzE3OTUx","avatar_url":"https://avatars2.githubusercontent.com/u/11317951?v=4","gravatar_id":"","url":"https://api.github.com/users/darekg11","html_url":"https://github.com/darekg11","followers_url":"https://api.github.com/users/darekg11/followers","following_url":"https://api.github.com/users/darekg11/following{/other_user}","gists_url":"https://api.github.com/users/darekg11/gists{/gist_id}","starred_url":"https://api.github.com/users/darekg11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darekg11/subscriptions","organizations_url":"https://api.github.com/users/darekg11/orgs","repos_url":"https://api.github.com/users/darekg11/repos","events_url":"https://api.github.com/users/darekg11/events{/privacy}","received_events_url":"https://api.github.com/users/darekg11/received_events","type":"User","site_admin":false},"repo":{"id":179820304,"node_id":"MDEwOlJlcG9zaXRvcnkxNzk4MjAzMDQ=","name":"react-native-emoji-input","full_name":"darekg11/react-native-emoji-input","private":false,"owner":{"login":"darekg11","id":11317951,"node_id":"MDQ6VXNlcjExMzE3OTUx","avatar_url":"https://avatars2.githubusercontent.com/u/11317951?v=4","gravatar_id":"","url":"https://api.github.com/users/darekg11","html_url":"https://github.com/darekg11","followers_url":"https://api.github.com/users/darekg11/followers","following_url":"https://api.github.com/users/darekg11/following{/other_user}","gists_url":"https://api.github.com/users/darekg11/gists{/gist_id}","starred_url":"https://api.github.com/users/darekg11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darekg11/subscriptions","organizations_url":"https://api.github.com/users/darekg11/orgs","repos_url":"https://api.github.com/users/darekg11/repos","events_url":"https://api.github.com/users/darekg11/events{/privacy}","received_events_url":"https://api.github.com/users/darekg11/received_events","type":"User","site_admin":false},"html_url":"https://github.com/darekg11/react-native-emoji-input","description":null,"fork":true,"url":"https://api.github.com/repos/darekg11/react-native-emoji-input","forks_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/forks","keys_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/keys{/key_id}","collaborators_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/teams","hooks_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/hooks","issue_events_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/issues/events{/number}","events_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/events","assignees_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/assignees{/user}","branches_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/branches{/branch}","tags_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/tags","blobs_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/git/refs{/sha}","trees_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/git/trees{/sha}","statuses_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/statuses/{sha}","languages_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/languages","stargazers_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/stargazers","contributors_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/contributors","subscribers_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/subscribers","subscription_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/subscription","commits_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/commits{/sha}","git_commits_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/git/commits{/sha}","comments_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/comments{/number}","issue_comment_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/issues/comments{/number}","contents_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/contents/{+path}","compare_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/compare/{base}...{head}","merges_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/merges","archive_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/downloads","issues_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/issues{/number}","pulls_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/pulls{/number}","milestones_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/milestones{/number}","notifications_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/labels{/name}","releases_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/releases{/id}","deployments_url":"https://api.github.com/repos/darekg11/react-native-emoji-input/deployments","created_at":"2019-04-06T10:39:37Z","updated_at":"2019-04-06T10:39:39Z","pushed_at":"2019-04-06T11:58:55Z","git_url":"git://github.com/darekg11/react-native-emoji-input.git","ssh_url":"git@github.com:darekg11/react-native-emoji-input.git","clone_url":"https://github.com/darekg11/react-native-emoji-input.git","svn_url":"https://github.com/darekg11/react-native-emoji-input","homepage":"","size":109874,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":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":"sskhandek:master","ref":"master","sha":"1a398b0a0f0ff508b4491c80e54e1e3d59ed9e2f","user":{"login":"sskhandek","id":5349493,"node_id":"MDQ6VXNlcjUzNDk0OTM=","avatar_url":"https://avatars2.githubusercontent.com/u/5349493?v=4","gravatar_id":"","url":"https://api.github.com/users/sskhandek","html_url":"https://github.com/sskhandek","followers_url":"https://api.github.com/users/sskhandek/followers","following_url":"https://api.github.com/users/sskhandek/following{/other_user}","gists_url":"https://api.github.com/users/sskhandek/gists{/gist_id}","starred_url":"https://api.github.com/users/sskhandek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sskhandek/subscriptions","organizations_url":"https://api.github.com/users/sskhandek/orgs","repos_url":"https://api.github.com/users/sskhandek/repos","events_url":"https://api.github.com/users/sskhandek/events{/privacy}","received_events_url":"https://api.github.com/users/sskhandek/received_events","type":"User","site_admin":false},"repo":{"id":122682892,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI2ODI4OTI=","name":"react-native-emoji-input","full_name":"sskhandek/react-native-emoji-input","private":false,"owner":{"login":"sskhandek","id":5349493,"node_id":"MDQ6VXNlcjUzNDk0OTM=","avatar_url":"https://avatars2.githubusercontent.com/u/5349493?v=4","gravatar_id":"","url":"https://api.github.com/users/sskhandek","html_url":"https://github.com/sskhandek","followers_url":"https://api.github.com/users/sskhandek/followers","following_url":"https://api.github.com/users/sskhandek/following{/other_user}","gists_url":"https://api.github.com/users/sskhandek/gists{/gist_id}","starred_url":"https://api.github.com/users/sskhandek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sskhandek/subscriptions","organizations_url":"https://api.github.com/users/sskhandek/orgs","repos_url":"https://api.github.com/users/sskhandek/repos","events_url":"https://api.github.com/users/sskhandek/events{/privacy}","received_events_url":"https://api.github.com/users/sskhandek/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sskhandek/react-native-emoji-input","description":null,"fork":false,"url":"https://api.github.com/repos/sskhandek/react-native-emoji-input","forks_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/forks","keys_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/teams","hooks_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/hooks","issue_events_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/issues/events{/number}","events_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/events","assignees_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/assignees{/user}","branches_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/branches{/branch}","tags_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/tags","blobs_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/git/refs{/sha}","trees_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/statuses/{sha}","languages_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/languages","stargazers_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/stargazers","contributors_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/contributors","subscribers_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/subscribers","subscription_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/subscription","commits_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/commits{/sha}","git_commits_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/git/commits{/sha}","comments_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/comments{/number}","issue_comment_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/issues/comments{/number}","contents_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/contents/{+path}","compare_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/merges","archive_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/downloads","issues_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/issues{/number}","pulls_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls{/number}","milestones_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/milestones{/number}","notifications_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/labels{/name}","releases_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/releases{/id}","deployments_url":"https://api.github.com/repos/sskhandek/react-native-emoji-input/deployments","created_at":"2018-02-23T23:20:53Z","updated_at":"2019-04-06T08:40:48Z","pushed_at":"2019-04-06T12:02:34Z","git_url":"git://github.com/sskhandek/react-native-emoji-input.git","ssh_url":"git@github.com:sskhandek/react-native-emoji-input.git","clone_url":"https://github.com/sskhandek/react-native-emoji-input.git","svn_url":"https://github.com/sskhandek/react-native-emoji-input","homepage":"","size":109835,"stargazers_count":24,"watchers_count":24,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":9,"open_issues":5,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/34"},"html":{"href":"https://github.com/sskhandek/react-native-emoji-input/pull/34"},"issue":{"href":"https://api.github.com/repos/sskhandek/react-native-emoji-input/issues/34"},"comments":{"href":"https://api.github.com/repos/sskhandek/react-native-emoji-input/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sskhandek/react-native-emoji-input/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/sskhandek/react-native-emoji-input/statuses/60feb0cd873055a4d9874a378151a963cfc9b912"}},"author_association":"NONE"}}
{"actor":{"display_login":"rijn"}}