-
-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove nanoid and react-native-redash to clean up some build i…
…ssues (#1046) * chore: remove nanoid and react-native-redash to clean up some build issues * chore: put back invariant dependency Co-authored-by: gorhom <[email protected]>
- Loading branch information
Showing
7 changed files
with
31 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const clamp = ( | ||
value: number, | ||
lowerBound: number, | ||
upperBound: number | ||
) => { | ||
'worklet'; | ||
return Math.min(Math.max(lowerBound, value), upperBound); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
let current = 0; | ||
|
||
export const id = () => { | ||
current = (current + 1) % Number.MAX_SAFE_INTEGER; | ||
return current; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export const snapPoint = ( | ||
value: number, | ||
velocity: number, | ||
points: ReadonlyArray<number> | ||
): number => { | ||
'worklet'; | ||
const point = value + 0.2 * velocity; | ||
const deltas = points.map(p => Math.abs(point - p)); | ||
const minDelta = Math.min.apply(null, deltas); | ||
return points.filter(p => Math.abs(point - p) === minDelta)[0]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters