Created
April 18, 2018 17:55
-
-
Save nogtini/fdf7076f9628a125a43a714815ca4e8d to your computer and use it in GitHub Desktop.
PizzaOrder component connecting to Interactors and Selectors
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
import {PizzaOrderSelectors} from '@themes/PizzaOrder/PizzaOrder.selectors'; | |
import {PizzaOrderInteractors} from '@themes/PizzaOrder/PizzaOrder.interactors'; | |
ngOnInit() { | |
this.userName$ = this.store.select(PizzaOrderSelectors.selectUserName); | |
this.pizzaTopping$ = this.store.select(PizzaOrderSelectors.selectPizzaToppings); | |
this.pizzaCrustType$ = this.store.select(PizzaOrderSelectors.selectPizzaCrustType); | |
this.deliveryEstimate$ = this.store.select(PizzaOrderSelectors.selectDeliveryEstimate); | |
this.driverName$ = this.store.select(PizzaOrderSelectors.selectDriverName); | |
this.driverCarType$ = this.store.select(PizzaOrderSelectors.selectDriverCarType); | |
} | |
displayModal() { | |
this.store.dispatch(new PizzaOrderInteractors.DisplayModal()); | |
} | |
addTopping(topping) { | |
this.store.dispatch(new PizzaOrderInteractors.AddTopping(topping)); | |
} | |
addCrustType(crustType) { | |
this.store.dispatch(new PizzaOrderInteractors.AddCrustType(crustType)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment