Where is this send comes from ?
See original GitHub issueconst document = require('global/document')
const choo = require('choo')
const http = require('choo/http')
const app = choo()
function view (params, state, send) {
return choo.view`
<form onsubmit=${onSubmit}>
<fieldset>
<label>username</label>
<input type="text" name="username" autofocus>
</fieldset>
<fieldset>
<label>password</label>
<input type="password" name="password">
</fieldset>
<input type="submit" value="Submit">
</form>
`
function onSubmit (event) {
send('login', { data: new FormData(event.target) }) // where is the send comes from ?
event.preventDefault()
}
}
app.model({
effects: {
login: (action, state, send) => {
http.post('/login', { body: action.data }, (err, res, body) => {
send('authorize', { payload: body })
})
}
}
})
app.router((route) => [
route('/', view)
])
app.start()
edit by @yoshuawuyts: updated for syntax highlighting
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to determine where an email was sent from (tutorial)
This video explains how to trace an email back to where it originated (or was sent from). This does not mean that the...
Read more >send it Meaning & Origin | Slang by Dictionary.com
Enticer's send it comes from the rock-climbing slang, send, a run in which a climber completes a route without falling or resting.
Read more >send - Wiktionary
EtymologyEdit ... From Middle English senden, from Old English sendan (“to send, cause to go”), from Proto-West Germanic *sandijan, from Proto-Germanic *sandijaną ...
Read more >Sent email in Outlook.com comes back "delivery failed"
Try these solutions if sent messages in Outlook.com come back with a "delivery failed" error.
Read more >Send emails from a different address or alias - Gmail Help
Tip: You can send emails from up to 99 different email addresses. Step 1: Add an address you own. On your computer, open...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@crapthings note that
onSubmit
is a function within a function, thus it has access to the parent function’s scope.@crapthings can I assume this has been resolved?