Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function intent(domSources) {
- return domSources.select('.field').events('input')
- .map(ev => ev.target.value)
- }
- function model(action) {
- return action.map(inputValue => inputValue).startWith(‘’)
- }
- function view(state$) {
- return state$.map(state =>(div([‘Twój stan aplikacji: ’ + state]))
- }
- function main(sources) {
- const action = intent(sources.DOM)
- const state$ = model(action)
- const vdom$ = view(state$)
- return { DOM: vdom$ }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement