Created
November 29, 2010 07:07
-
-
Save destroytoday/719678 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package com.destroytoday.example | |
{ | |
public class GetFollowerIDListCommand extends AsyncSignalCommand | |
{ | |
[Inject] | |
public var twitterService:ITwitterService; | |
[Inject] | |
public var followerModel:FollowerModel; | |
protected var promise:IPromise; | |
public function GetFollowerIDListCommand() | |
{ | |
} | |
override public function execute():void | |
{ | |
promise = twitterService.getFollowerIDList(); | |
promise.completed.add(completedHandler); | |
promise.failed.add(failedHandler); | |
} | |
// in case you are paranoid | |
override protected function release():void | |
{ | |
super.release(); | |
promise = null; | |
} | |
protected function completedHandler(result:*):void | |
{ | |
followerModel.idList = result; | |
dispatchComplete(); | |
} | |
protected function failedHandler(error:*):void | |
{ | |
dispatchFail(error); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment