我是新来的asynch,我想用asynch用firebase,一旦标记设置我想射击的动作,fetchEvents和navigate
async setToken() {
const fcmToken = await firebase.messaging().getToken();
return fcmToken;
}
onSubmit(e) {
const {
navigation: { navigate },
credentials: { year, group, student },
fetchEvents
} = this.props;
AsyncStorage.setItem(
"loggedIn",
JSON.stringify(this.props.credentials)
);
const token = this.setToken();
if (token) {
fetchEvents(student || group);
navigate("Month");
}
}
如果我token在调试器中进行检查,那是一个承诺:
_40: 0
_55: null
_65: 0
_72: null
如何asynch使用我的功能?
跃然一笑
慕妹3242003
相关分类