Skip to content

Commit fbf4223

Browse files
authored
Merge pull request #84 from Shopify/fix/use-timestamp
Rename useProgress to useTimestamp
2 parents bd626a7 + ff23ef0 commit fbf4223

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

docs/docs/animations/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ The `useTiming` hook will create a timing based animation that changes the retur
5858

5959
The `useSpring` hook will create a spring based animation that changes the returned animation value with the results from doing a physics simulation.
6060

61-
### useProgress
61+
### useTimestamp
6262

63-
The `useSprogress` hook will return an animation value that contains the number of milliseconds that passed since the cavans started to draw.
63+
The `useTimestamp` hook will return an animation value that contains the number of milliseconds that passed since the cavans started to draw.
6464

6565
### useTouchHandler
6666

example/src/Examples/Animation/SimpleValueOverTime.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from "react";
22
import { Dimensions, StyleSheet } from "react-native";
3-
import { Canvas, mix, useProgress } from "@shopify/react-native-skia";
3+
import { Canvas, mix, useTimestamp } from "@shopify/react-native-skia";
44

55
import { AnimationElement, AnimationDemo, Padding } from "./Components";
66

77
const { width } = Dimensions.get("window");
88

99
export const SimpleValueOverTime = () => {
10-
const progress = useProgress();
10+
const progress = useTimestamp();
1111
return (
1212
<AnimationDemo title={"Simple animation of value over time"}>
1313
<Canvas style={styles.canvas}>

package/src/animation/Animation/hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ export const useTimeline = (initializer: (tla: TimelineAnimation) => void) => {
4141
};
4242

4343
/**
44-
* Creates a progress animation where the provided value will be updated with
44+
* Creates an animation value where the provided value will be updated with
4545
* the progress in seconds since the animation started.
4646
* @returns An animation value that will be updated by the animation
4747
*/
48-
export const useProgress = (): AnimationValue => {
48+
export const useTimestamp = (): AnimationValue => {
4949
const animation = useMemo(() => {
5050
return AnimationFactory();
5151
}, []);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { useLoop, useProgress, useSpring, useTiming } from "./hooks";
1+
export { useLoop, useTimestamp, useSpring, useTiming } from "./hooks";

0 commit comments

Comments
 (0)