Skip to content

Immutable API

Choose a tag to compare

@DavidDuwaer DavidDuwaer released this 26 Oct 11:50
· 87 commits to master since this release
  • Query building method chain is now immutable
    For instance, from now on we can do this:
    const allStudentsQuery = Student
        .with('university');
    const firstYearStudentsQuery = allStudentsQuery
        .where('year', 1);
    In version <2, the second statement would have mutated allStudentsQuery as well, and both queries would have been exactly the same. From this release, both allStudentsQuery and firstYearStudentsQuery are what their names describe them to be.