本文整理匯總了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 })
}