小编tri*_*ger的帖子

Linkedin Oauth Javascript授权"呃哦!"

我无法使用Linkedin登录我的应用程序,我看到模式链接对话框"哦哦!" 该怎么办?为什么不工作OUauth?

function onLinkedInLoad() {
  IN.Event.on(IN, "auth", function() {onLinkedInLogin();});
  IN.Event.on(IN, "logout", function() {onLinkedInLogout();});
}
function onLinkedInLogin() {
  IN.API.Profile("me")
    .fields(["id", "firstName", "lastName", "pictureUrl", "publicProfileUrl", "emailAddress"])
    .result(function(result) {

      console.log(firstName);
    })
    .error(function(err) {
      alert(err);
    });
}
function liAuth(){
  // 
   IN.User.authorize(function(){
       callback();
   });
   //IN.UI.Authorize().place();
}
Run Code Online (Sandbox Code Playgroud)
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
    api_key: 54545645645646
    authorize: false
    onLoad: onLinkedInLoad
</script>

<div onclick="liAuth()" class="loginsocbutton loginsocbutton__in" id="oauth_linkedin">click</div>
Run Code Online (Sandbox Code Playgroud)

javascript oauth linkedin

12
推荐指数
1
解决办法
9105
查看次数

在 ngrx Effect 中将 Promise 转换为 Observable

我正在使用给出承诺的第三方库,但我需要将其包装到 ngrx 效果的 Observable 中。这个想法是在应用程序成功初始化时调度新操作。但我需要在承诺解决后发送数据。

classOne.promise().then(result =>
  nested.OnemorePromise(result).then(result2 =>
    //(result2) dispatch new action here (result2)
  )
);
Run Code Online (Sandbox Code Playgroud)

我创建了这样的东西:

classOne.promise().then(result =>
  nested.OnemorePromise(result).then(result2 =>
    //(result2) dispatch new action here (result2)
  )
);
Run Code Online (Sandbox Code Playgroud)
它给了我错误 - 效果是调度错误的操作。

更新:

@Effect()
  initializeValue$: Observable<Action> = this.actions$.pipe(
    ofAction(AppInitializeAction),
    map(action => {
      classOne.promise().then(result =>
      nested.OnemorePromise(result).then(result2 =>
         this.store.dispatch(new Action(result2))
// ideally just - return new Action(result2)
      )
    );
    })
Run Code Online (Sandbox Code Playgroud)

地图不是函数。

promise redux ngrx angular

4
推荐指数
1
解决办法
7218
查看次数

标签 统计

angular ×1

javascript ×1

linkedin ×1

ngrx ×1

oauth ×1

promise ×1

redux ×1