presentations/highlight-js/test/markup/reasonml/functions.txt

22 lines
716 B
Text
Raw Normal View History

2018-12-07 08:48:05 -06:00
/* This is a simple function */
let greet = (name) => "Hello World";
let body = `Plain("uploaded " ++ cacheServiceConfig.desc ++ "configuration data into cache on S3");
let getCacheConfigByEnv =
(
environment: environment,
cacheServiceConfig: Js.Dict.t(cachingServiceConfig)
) =>
switch (cacheServiceConfig) {
| Some(config) => config
| None =>
raise(InvalidEnvironment("Caching Service Coinfiguration is missing"))
};
let readCacheServiceConfigAndDecode = (configJson) =>
switch (configJson |> Js.Json.decodeObject) {
| None => raise(Json.Decode.DecodeError("Invalid Cache Config"))
| Some(data) =>
data |> Js.Dict.map((. json) => CachingServiceConfig.decode(json))
};