Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logic file #49

Open
engshorouq opened this issue Feb 19, 2020 · 0 comments
Open

logic file #49

engshorouq opened this issue Feb 19, 2020 · 0 comments

Comments

@engshorouq
Copy link

searchBtn.onclick = () => {
const text = searchInput.value.trim();
console.log(text)
if (text !== "") {
fetch('/search', {
method: 'post',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: text,
})
})
.then(res => res.json())
.then(res => renderSearch(res.hits));
} else {
searchInput.style.borderColor = "#f00";
searchInput.style.backgroundColor = "#faa";
}
}

when I read the name of the file expect I will see pure functions but the code inside it is not logic,
the logic is the js functions when give it the input will give me every time the same output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant