I being trying to make a request to a REST endpoint using the CycleJS HTTP driver, but the way I'm getting the values of the input fields is not Reactive, but I'm not being able to find a way to do it (the right way)
User case:
The user fills the UserName and Password fields, then he clicks the "Sign up", the request get done with the input fields as data.
But if I create a xs-stream of the fields,the value is never set for the HTTP Request.
So what I ended up doing is:
.select('.btn-signup').events('click')
.map( ev => {
let request = API.requestCreate;
// TODO - search for the best way to use the values.
var user = document.querySelector('.user-input').value;
var pass = document.querySelector('.user-password').value;
if(user && pass ) {
request.send = { username:user, password: pass };
return request;
}
});
I'm definitely missing something but not being able to find a solution for it.