mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
feat(edge/templates): introduce edge specific settings [EE-6276] (#10609)
This commit is contained in:
parent
68950fbb24
commit
e43d076269
42 changed files with 885 additions and 319 deletions
12
app/react-tools/apply-set-state-action.ts
Normal file
12
app/react-tools/apply-set-state-action.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { SetStateAction } from 'react';
|
||||
|
||||
export function applySetStateAction<T>(applier: SetStateAction<T>, values?: T) {
|
||||
if (isFunction(applier)) {
|
||||
return values ? applier(values) : undefined;
|
||||
}
|
||||
return applier;
|
||||
|
||||
function isFunction(value: unknown): value is (prevState: T) => T {
|
||||
return typeof value === 'function';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue