本文整理匯總了TypeScript中lodash-es.omit函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript omit函數的具體用法?TypeScript omit怎麽用?TypeScript omit使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了omit函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: produce
return produce(object, draft => {
if (parentPath.length === 0) {
return omit(draft, [path[path.length - 1]]);
}
const o = get(draft, parentPath);
const n = omit(o, [path[path.length - 1]]);
set(draft, parentPath, n);
});
示例2: switch
(state: GameState, action: StateActions) => {
switch (action.type) {
case ActionType.MANAGED_MODE: {
const games = action.payload.updatedEntities.games;
const deletedKeys = Object.keys(action.payload.deletedEntities.games);
return { ...omit(state, deletedKeys), ...games };
}
}
return state;
},