Permissions popup context iso
This commit is contained in:
parent
f3715411c6
commit
7b5faa1cc1
49 changed files with 562 additions and 506 deletions
11
ts/hooks/usePrevious.ts
Normal file
11
ts/hooks/usePrevious.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2020-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { useRef } from 'react';
|
||||
|
||||
export function usePrevious<T>(initialValue: T, currentValue: T): T {
|
||||
const previousValueRef = useRef<T>(initialValue);
|
||||
const result = previousValueRef.current;
|
||||
previousValueRef.current = currentValue;
|
||||
return result;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue