本文整理汇总了TypeScript中js-cookie.remove函数的典型用法代码示例。如果您正苦于以下问题:TypeScript remove函数的具体用法?TypeScript remove怎么用?TypeScript remove使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: switch
(state: TokenStateSchema = TokenEmptyState, action: TokenAction) => {
switch (action.type) {
case actionTypes.RECEIVE_TOKEN:
Cookies.set('token', action.token.token);
Cookies.set('user', action.username);
return {
...state,
user: action.username,
token: action.token.token
};
case actionTypes.DISCARD_TOKEN:
Cookies.remove('token');
Cookies.remove('user');
Cookies.remove('sessionid');
Cookies.remove('csrftoken');
return {
...state,
user: '',
token: ''
};
default:
return state;
}
};
示例2: cookieDomain
return dispatch => {
cookies.remove("gitHubAuthState", { domain: cookieDomain() });
cookies.remove("gitHubAuthToken", { domain: cookieDomain() });
cookies.remove("featureFlags", { domain: cookieDomain() });
};
示例3: deleteAuthToken
public deleteAuthToken(): void {
Cookie.remove(COOKIE_AUTH_TOKEN_KEY);
}
示例4: removeToken
export function removeToken() {
return Cookies.remove(TokenKey);
}
示例5:
return dispatch => {
cookies.remove("gitHubAuthState");
cookies.remove("gitHubAuthToken");
cookies.remove("featureFlags");
};
示例6: reload
reload ({ dispatch }): void {
dispatch('beforeunloadAlertEventListener', 'remove')
window.location.reload()
},
closeTab ({ dispatch }): void {
dispatch('beforeunloadAlertEventListener', 'remove')
window.close()
},
getCookie ({ state }, name: string) {
return Cookies.get(name)
},
setCookie ({ state }, params): void {
Cookies.set(params.name, params.value)
},
removeCookie ({ state }, name: string): void {
Cookies.remove(name)
},
sendErrorLog ({ rootState }, error): void {
const detail =
typeof error === 'object' && error.stack !== 'undefined'
? error.stack
: error
GibsonApi.postLog(
rootState.lesson.lessonInfo.registrationId,
'error',
detail
)
}
}
const mutations = {
示例7:
export const removeToken = ()=> {
return Cookies.remove(TokenKey)
}
示例8: remove
export function remove (key: string): void {
cookies.remove(key, { domain })
}