Advertisement
Guest User

Untitled

a guest
Aug 7th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. public class ActionsCreator {
  2.  
  3. private let _dispatcher: FluxDispatcher
  4.  
  5. public init(dispatcher: FluxDispatcher) {
  6. _dispatcher = dispatcher
  7. }
  8.  
  9. public func clickedLogin(username: String, password: String) {
  10. // Make a call to your back-end and log the user in
  11. let user = WebAPI.loginUser()
  12. // When it's done dispatch an action to update the store
  13. let action = Action(type: ActionType.ClickedLogin, data: user)
  14.  
  15. _dispatcher.dispatch(action)
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement