Created
June 7, 2017 07:51
-
-
Save hesher/3acb46de6a5ea6314382da4822672710 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
const SiteBuilder = value => ({ | |
withSiteName: name => SiteBuilder({...value, ...{name}}), | |
withDomain: domain => SiteBuilder({...value, ...{domain}}), | |
build: () => value | |
}); | |
const site = SiteBuilder({}) | |
.withSiteName('hello') | |
.withDomain('some-domain') | |
.build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment