New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@equinor/fusion

Package Overview
Dependencies
Maintainers
2
Versions
485
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equinor/fusion - npm Package Compare versions

Comparing version 0.1.79 to 0.1.80

10

lib/hooks/useSorting.d.ts
export declare type PropertyAccessorFunction<T> = (item: T) => string | null;
export declare type PropertyAccessor<T> = keyof T | PropertyAccessorFunction<T>;
export declare type SortDirection = "asc" | "desc";
export declare const applySorting: <T>(data: T[], sortBy?: PropertyAccessorFunction<T> | keyof T | null, direction?: "desc" | "asc" | null) => T[];
declare const _default: <T>(data: T[], defaultSortBy?: PropertyAccessorFunction<T> | keyof T | null, defaultDirection?: "desc" | "asc" | null) => {
sortedData: T[];
export declare const applySorting: <T>(data: readonly T[], sortBy?: PropertyAccessorFunction<T> | keyof T | null, direction?: "desc" | "asc" | null) => readonly T[];
declare const _default: <T>(data: readonly T[], defaultSortBy?: PropertyAccessorFunction<T> | keyof T | null, defaultDirection?: "desc" | "asc" | null) => {
sortedData: readonly T[];
sortBy: PropertyAccessorFunction<T> | keyof T | null;
direction: "desc" | "asc" | null;
set: (newSortBy: PropertyAccessorFunction<T> | keyof T | null, newDirection: "desc" | "asc" | null) => void;
reset: () => void;
setSortBy: (newSortBy: PropertyAccessorFunction<T> | keyof T | null, newDirection: "desc" | "asc" | null) => void;
resetSorting: () => void;
};
export default _default;

@@ -18,3 +18,3 @@ import { useState, useEffect } from "react";

}
const comparer = new Intl.Collator().compare;
const comparer = new Intl.Collator('co', { numeric: true }).compare;
return data.slice().sort((a, b) => {

@@ -51,7 +51,7 @@ const aValue = getValue(a, sortBy);

}, [data, sortBy, direction]);
const reset = () => {
const resetSorting = () => {
setSortBy(null);
setDirection(null);
};
const set = (newSortBy, newDirection) => {
const updateSortBy = (newSortBy, newDirection) => {
newDirection =

@@ -68,5 +68,5 @@ newDirection || sortBy === newSortBy || !newSortBy

direction,
set,
reset,
setSortBy: updateSortBy,
resetSorting,
};
};

@@ -38,2 +38,2 @@ export declare type Page = {

};
export declare const useAsyncPagination: <T>(fetchAsync: (pagination: Pagination) => Promise<PagedResult<T>>, initialPerPage: number, initialCurrentPageIndex?: number, padding?: number) => AsyncPaginationHook<T>;
export declare const useAsyncPagination: <T>(fetchAsync: (pagination: Pagination) => Promise<PagedResult<T>>, initialPerPage: number, initialCurrentPageIndex?: number, padding?: number, deps?: readonly any[]) => AsyncPaginationHook<T>;

@@ -90,3 +90,3 @@ import { useState, useEffect, useCallback } from "react";

};
export const useAsyncPagination = (fetchAsync, initialPerPage, initialCurrentPageIndex = 0, padding = 3) => {
export const useAsyncPagination = (fetchAsync, initialPerPage, initialCurrentPageIndex = 0, padding = 3, deps = []) => {
const [currentPageIndex, setCurrentPageIndex] = useState(initialCurrentPageIndex);

@@ -121,3 +121,3 @@ const [perPage, setPerPage] = useState(initialPerPage);

return applyPaginationAsync();
}, [currentPageIndex, perPage]);
}, [currentPageIndex, perPage, ...deps]);
const setCurrentPage = useCallback((index, perPage) => {

@@ -124,0 +124,0 @@ setCurrentPageIndex(index);

{
"name": "@equinor/fusion",
"version": "0.1.79",
"version": "0.1.80",
"description": "Everything a Fusion app needs to communicate with the core",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc