Last active
October 25, 2017 11:07
-
-
Save knaman2609/e63bef78631ef82474f4f8962c842c9e 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
exports.inp1 = function(sub) { | |
var count = 0; | |
var b = document.querySelector("body"); | |
b.addEventListener("click", function() { | |
sub(count + ""); | |
count ++ ; | |
}); | |
window.SUB = sub; | |
} | |
exports.inp2 = function(sub) { | |
setTimeout(function(){sub("def")}, 1000) | |
} |
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
import Control.Monad.Eff | |
import Control.Monad.Eff.Console | |
import Data.List | |
import FRP.Behavior | |
import FRP.Event | |
import FRP.Event.Time | |
import Prelude | |
foreign import inp1 :: Event String | |
foreign import inp2 :: Event String | |
inp1Beh = step "inp1" inp1 | |
inp2Beh = step "inp2" inp2 | |
addInp a b = a <> b | |
inpValidBeh = addInp <$> inp1Beh <*> inp2Beh | |
main = sample_ inpValidBeh inp1 `subscribe` logShow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment