Skip to content

Instantly share code, notes, and snippets.

@hesher
Created June 7, 2017 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hesher/3acb46de6a5ea6314382da4822672710 to your computer and use it in GitHub Desktop.
Save hesher/3acb46de6a5ea6314382da4822672710 to your computer and use it in GitHub Desktop.
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