-
-
Save Chester97/0519651367ae9c4f3e6050bd5cf2fe09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const vat_input: HTMLInputElement = document.querySelector(".vat_input"); | |
const netto_input: HTMLInputElement = document.querySelector(".netto_input"); | |
const add_inputs_button: HTMLButtonElement = document.querySelector(".add_inputs_button"); | |
const result_value: HTMLDivElement = document.querySelector(".result_value"); | |
const vatInputEvent$ = fromEvent(vat_input, 'change').pipe( | |
pluck('target', 'value'), | |
map((val) => val ? parseFloat(String(val)) : 0), | |
map((val) => isFloat(val) ? parseFloat(val.toFixed(2)) : val), | |
distinctUntilChanged(), | |
); | |
const nettoInputEvent$ = fromEvent(netto_input, 'change').pipe( | |
pluck('target', 'value'), | |
map((val) => val ? parseFloat(String(val)) : 0), | |
map((val) => isFloat(val) ? parseFloat(val.toFixed(2)) : val), | |
distinctUntilChanged(), | |
); | |
const foo$ = combineLatest([vatInputEvent$, nettoInputEvent$], (a,b) => { | |
return {a,b} | |
}); | |
const addInputsValueButton$ = fromEvent(add_inputs_button, 'click').subscribe(() => WHAT NOW?); // How to get values from foo$ here? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment