Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ActionsCreator {
- private let _dispatcher: FluxDispatcher
- public init(dispatcher: FluxDispatcher) {
- _dispatcher = dispatcher
- }
- public func clickedLogin(username: String, password: String) {
- // Make a call to your back-end and log the user in
- let user = WebAPI.loginUser()
- // When it's done dispatch an action to update the store
- let action = Action(type: ActionType.ClickedLogin, data: user)
- _dispatcher.dispatch(action)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement