Removed all default export except for services and reducers

This commit is contained in:
Alejandro Celaya
2022-05-28 11:16:59 +02:00
parent 2cac1d9fd2
commit 1d60db25bd
92 changed files with 159 additions and 214 deletions

View File

@@ -1,6 +1,6 @@
import { isNil } from 'ramda';
import { rangeOf } from '../utils';
import LocalStorage from './LocalStorage';
import { LocalStorage } from './LocalStorage';
const HEX_COLOR_LENGTH = 6;
const HEX_DIGITS = '0123456789ABCDEF';
@@ -15,7 +15,7 @@ const hexColorToRgbArray = (colorHex: string): number[] =>
// HSP by Darel Rex Finley https://alienryderflex.com/hsp.html
const perceivedLightness = (r = 0, g = 0, b = 0) => round(sqrt(0.299 * r ** 2 + 0.587 * g ** 2 + 0.114 * b ** 2));
export default class ColorGenerator {
export class ColorGenerator {
private readonly colors: Record<string, string>;
private readonly lights: Record<string, boolean>;

View File

@@ -1,7 +1,7 @@
const PREFIX = 'shlink';
const buildPath = (path: string) => `${PREFIX}.${path}`;
export default class LocalStorage {
export class LocalStorage {
public constructor(private readonly localStorage: Storage) {}
public readonly get = <T>(key: string): T | undefined => {

View File

@@ -1,7 +1,7 @@
import Bottle from 'bottlejs';
import { useStateFlagTimeout } from '../helpers/hooks';
import LocalStorage from './LocalStorage';
import ColorGenerator from './ColorGenerator';
import { LocalStorage } from './LocalStorage';
import { ColorGenerator } from './ColorGenerator';
import { csvToJson, jsonToCsv } from '../helpers/csvjson';
const provideServices = (bottle: Bottle) => {