UNPKG

bucklescript-tea

Version:
34 lines (29 loc) 843 B
// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE 'use strict'; var Curry = require("bs-platform/lib/js/curry.js"); var Caml_option = require("bs-platform/lib/js/caml_option.js"); function spawn(initState, update, shutdown) { var state = { contents: Caml_option.some(initState) }; return (function (procMsg) { var match = state.contents; if (match !== undefined) { var model = Caml_option.valFromOption(match); if (procMsg) { state.contents = Curry._2(update, model, procMsg[0]); return /* () */0; } else { Curry._1(shutdown, model); state.contents = undefined; return /* () */0; } } else { return /* () */0; } }); } var testing1 = 42; exports.spawn = spawn; exports.testing1 = testing1; /* No side effect */