🪖 Moves lerp to math utilities
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
export * from './result'
|
||||
export * from './string-utilities'
|
||||
export * from './math-utilities'
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export const lerp = (start: number, end: number, amt: number) => {
|
||||
return (1 - amt) * start + amt * end;
|
||||
};
|
||||
@@ -1,9 +1,5 @@
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export const lerp = (start: number, end: number, amt: number) => {
|
||||
return (1 - amt) * start + amt * end;
|
||||
};
|
||||
|
||||
export const persistentStore = (key:string, initialValue:any) => {
|
||||
const savedValue = JSON.parse(localStorage.getItem(key) as string);
|
||||
const data = savedValue !== null ? savedValue : initialValue;
|
||||
|
||||
Reference in New Issue
Block a user