{"size": 366, "ext": "js", "max_stars_repo_path": "src/js/SearchInput.js", "max_stars_repo_name": "mcsolha/localiza-ae", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/js/SearchInput.js", "max_issues_repo_name": "mcsolha/localiza-ae", "max_issues_repo_issues_event_min_datetime": "2020-05-11T19:08:06.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-10T17:15:19.000Z", "max_forks_repo_path": "src/js/SearchInput.js", "max_forks_repo_name": "mcsolha/localiza-ae", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 22.875, "max_line_length": 54, "alphanum_fraction": 0.6475409836}
function SearchInput({ onInputChange, state }) {
    let ref = document.getElementById('search-input');

    state.observe('inputValue', (_, newValue) => {
        ref.value = newValue;
    });

    function inputHandler({ target }) {
        onInputChange(target.value.trim());
    }

    ref.addEventListener('input', inputHandler);
}

export default SearchInput;
