{"action":"opened","issue":{"url":"https://api.github.com/repos/Moya/Moya/issues/927","repository_url":"https://api.github.com/repos/Moya/Moya","labels_url":"https://api.github.com/repos/Moya/Moya/issues/927/labels{/name}","comments_url":"https://api.github.com/repos/Moya/Moya/issues/927/comments","events_url":"https://api.github.com/repos/Moya/Moya/issues/927/events","html_url":"https://github.com/Moya/Moya/issues/927","id":201521243,"number":927,"title":"Can we return value inside provider.request ?","user":{"login":"abadikaka","id":7501729,"avatar_url":"https://avatars.githubusercontent.com/u/7501729?v=3","gravatar_id":"","url":"https://api.github.com/users/abadikaka","html_url":"https://github.com/abadikaka","followers_url":"https://api.github.com/users/abadikaka/followers","following_url":"https://api.github.com/users/abadikaka/following{/other_user}","gists_url":"https://api.github.com/users/abadikaka/gists{/gist_id}","starred_url":"https://api.github.com/users/abadikaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadikaka/subscriptions","organizations_url":"https://api.github.com/users/abadikaka/orgs","repos_url":"https://api.github.com/users/abadikaka/repos","events_url":"https://api.github.com/users/abadikaka/events{/privacy}","received_events_url":"https://api.github.com/users/abadikaka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-18T09:36:46Z","updated_at":"2017-01-18T09:36:46Z","closed_at":null,"body":"Hi guys i am using newest Moya version and swift 3.0\r\nI have question, can we return some values in a function which will call a provider request ?\r\nI need it bcs i will use that values in objective-c bridging, since i will use it for react-native .\r\nThe below code i use always return \"\" instead of dict that will be filled inside provider.request\r\n\r\n```swift\r\npublic func setupRx() -> Any {\r\n        \r\n        provider = RxMoyaProvider<GitHub>()\r\n        var dict : Any? = \"\"\r\n        \r\n        provider.request(.bible).subscribe { event in\r\n            switch event {\r\n            case let .next(response):\r\n                //image = UIImage(data: response.data)\r\n                do{\r\n                    dict = try response.mapJSON()\r\n                    try print(\"Dict is : \", dict)\r\n                }catch {\r\n                    print(\"Something wrong\");\r\n                }\r\n            case let .error(error):\r\n                print(\"Error : \",error)\r\n            default:\r\n                break\r\n            }\r\n        }\r\n        return dict\r\n}\r\n\r\n\r\n//BRIDGING CODE in Obj-C for react-native\r\n\r\nRCT_EXPORT_METHOD(connectToHub\r\n                  \r\n                  :(RCTPromiseResolveBlock)resolve\r\n                  :(RCTPromiseRejectBlock)reject)\r\n{\r\n    RCTMain * helloWorld = [RCTMain newInstance];\r\n    //call setupRx\r\n    NSString *test = [helloWorld setupRx];\r\n    //always nil never get the value from API that has been called inside setupRx\r\n    NSLog(@\"Test Dictionary return : %@\", [helloWorld setupRx]);\r\n    [self.bridge.eventDispatcher sendAppEventWithName:@\"onHubConnected\" body:nil];\r\n}\r\n```\r\nThank you..\r\n"}}
{"actor":{"display_login":"abadikaka"}}