Skip to content

Instantly share code, notes, and snippets.

@Winwardo
Last active August 29, 2015 14:25

Revisions

  1. Topher Winward renamed this gist Jul 18, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Topher Winward revised this gist Jul 18, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion builder_1
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    // Telescoping constructor
    var employee = new Employee("John", "01234 56432", "07922344500", "53 Oakland Road", "Devon", "UK");
    var employee = Immutable(new Employee("John", "01234 56432", "07922344500", "53 Oakland Road", "Devon", "UK"));

    // With builder
    var employee = new EmployeeBuilder()
  3. Topher Winward created this gist Jul 18, 2015.
    12 changes: 12 additions & 0 deletions builder_1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    // Telescoping constructor
    var employee = new Employee("John", "01234 56432", "07922344500", "53 Oakland Road", "Devon", "UK");

    // With builder
    var employee = new EmployeeBuilder()
    .name("John")
    .phone("01234 56432")
    .mobile("07922344500")
    .addresslineone("53 Oakland Road")
    .county("Devon")
    .country("UK")
    .build();