<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
# wich-db-to-choose | |
| Requisito/Modelo DB | Relacional (sql) | Documental | Chave/Valor | Grafo | | |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|------------|-------------|-------| | |
| Integridade absoluta dos dados | x | x | | | | |
| Portabilidade | x | | | | | |
| Relatórios Gerenciais |
export function update<T>( | |
cache: T[] | undefined, | |
predicate: (value: T, index: number, data: T[]) => boolean, | |
updater: (data: T) => T | |
): T[] | undefined { | |
if (!cache) { | |
return cache; | |
} | |
const data = [...cache]; |
import * as React from 'react'; | |
export const paginateArray = (arr = [], size = 10) => | |
arr.reduce((acc, val, i) => { | |
const idx = Math.floor(i / size); | |
const page = acc[idx] || (acc[idx] = []); | |
page.push(val); | |
return acc; |
import { useCallback, useState } from 'react'; | |
import * as React from 'react'; | |
type Result = { | |
measureRef: (node: unknown) => void; | |
isIntersecting: boolean; | |
observer?: IntersectionObserver; | |
}; |
/** | |
* Update "current" list with "next" list values using some valid list key | |
* | |
* @param current "current" list | |
* @param next "next" list containing values to update into "current" list | |
* @param key used to map values to be updated | |
* @returns updated list | |
*/ | |
export function updateByListKey<T>(current: T[], next: T[], key: keyof T): T[] { | |
const listMap = new Map(); |
export const paginateArray = <T>(arr: T[] = [], size: number = 10): T[][] => | |
arr.reduce<T[][]>((acc, val, i) => { | |
const idx = Math.floor(i / size); | |
const page = acc[idx] || (acc[idx] = []); | |
page.push(val); | |
return acc; | |
}, []); |
import { useEffect, useState, useRef } from "react"; | |
function useOneClickOutside() { | |
const node = useRef(null); | |
const [open, setOpen] = useState(false); | |
const handleClickOutside = (e) => { | |
if (node.current.contains(e.target)) { | |
return; | |
} |
import * as React from 'react'; | |
const handleNextStep = maxStep => currentStep => { | |
if (maxStep) { | |
if (currentStep < maxStep) return currentStep + 1; | |
return currentStep; | |
} | |
return currentStep + 1; | |
}; |