Skip to content

Instantly share code, notes, and snippets.

@newerton
Created September 15, 2022 18:48
Show Gist options
  • Save newerton/26ee8cfb0eb438dd04ebe39d6c23f691 to your computer and use it in GitHub Desktop.
Save newerton/26ee8cfb0eb438dd04ebe39d6c23f691 to your computer and use it in GitHub Desktop.
Apply Dependency inversion principle (DIP)
import api from '~/common/api'
const ConnectedLoginForm = () => {
const handleSubmit = async (email, password) => {
await api.login(email, password)
}
return (
<LoginForm onSubmit={handleSubmit} />
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment