本文整理汇总了TypeScript中messaging/backend/actions.getFeedlyToken函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getFeedlyToken函数的具体用法?TypeScript getFeedlyToken怎么用?TypeScript getFeedlyToken使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getFeedlyToken函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: async
return async ({ dispatch, getState }) => {
dispatch({
type: 'ALL_ENTRIES_MARKING_AS_READ'
});
try {
const token = await dispatch(getFeedlyToken());
const categoryId = allStreamIdOf(token.id);
await feedlyApi.markAsReadForCategories(token.access_token, categoryId);
dispatch({
type: 'ALL_ENTRIES_MARKED_AS_READ'
});
const { subscriptions } = getState();
const numEntries = Object.values(subscriptions)
.reduce((total, subscription) => total + subscription.unreadCount, 0);
const message = numEntries === 1
? `${numEntries} entry is marked as read.`
: `${numEntries} entries are marked as read.`;
dispatch(sendNotification(
message,
'positive'
));
} catch (error) {
dispatch({
type: 'ALL_ENTRIES_MARKING_AS_READ_FAILED'
});
throw error;
}
};