Commit 5d730cbc by Wolfram Kriesing

Use the DestinationType in the builders. And use our first #refinement.

parent ab9c16f1
// @flow
class DestinationBuilder {
destination = {};
destination: DestinationType = { name: '' };
build() {
return this.destination;
}
......@@ -15,7 +15,8 @@ export class HotelBuilder extends DestinationBuilder {
this.destination.passions = [];
}
addPassion(passion: string) {
this.destination.passions.push(passion);
if (this.destination.passions)
this.destination.passions.push(passion);
return this;
}
addCity(city: string) {
......
type DestinationType = {
name: string;
city: string;
passions: Array<string>;
city?: string;
passions?: Array<string>;
};
type DestinationListType =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment