Created
April 3, 2018 15:56
-
-
Save jthegedus/abb9cd70ce1fb2fb80bfc354b01f7deb to your computer and use it in GitHub Desktop.
Reason BS labeled default args
This file contains hidden or 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
type options = { | |
. | |
"dir": string, | |
"key": string | |
}; | |
let defaultOptions: options = {"dir": "conf/", "key": "configuration"}; | |
let createConf = (~opts=defaultOptions, ()) => Js.log(opts); | |
/* | |
// Generated by BUCKLESCRIPT VERSION 2.2.3, PLEASE EDIT WITH CARE | |
'use strict'; | |
var defaultOptions = { | |
dir: "conf/", | |
key: "configuration" | |
}; | |
function createConf($staropt$star, _) { | |
var opts = $staropt$star ? $staropt$star[0] : defaultOptions; | |
console.log(opts); | |
return /* () */0; | |
} | |
exports.defaultOptions = defaultOptions; | |
exports.createConf = createConf; | |
/* No side effect */ | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment