Confine message selector cache to component
This commit is contained in:
parent
7f0ed2599d
commit
ef13eb06fc
11 changed files with 395 additions and 311 deletions
|
@ -1,11 +1,9 @@
|
|||
// Copyright 2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { has } from 'lodash';
|
||||
|
||||
export function getOwn<TObject extends object, TKey extends keyof TObject>(
|
||||
obj: TObject,
|
||||
key: TKey
|
||||
): TObject[TKey] | undefined {
|
||||
return has(obj, key) ? obj[key] : undefined;
|
||||
return Object.hasOwn(obj, key) ? obj[key] : undefined;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue