aboutsummaryrefslogtreecommitdiff
path: root/src/lib/motion/utils.ts
diff options
context:
space:
mode:
authorIndrajith K L2024-02-05 04:15:02 +0530
committerIndrajith K L2024-02-05 04:15:02 +0530
commitf05a472585b2506da21aed71f0252b2d4c04a221 (patch)
tree4f65a3801f29250a049f3cc5cd2ac9c0a41d78f9 /src/lib/motion/utils.ts
downloadreact-hooks-training-f05a472585b2506da21aed71f0252b2d4c04a221.tar.gz
react-hooks-training-f05a472585b2506da21aed71f0252b2d4c04a221.tar.bz2
react-hooks-training-f05a472585b2506da21aed71f0252b2d4c04a221.zip
React Slides
* Adds useState * State * useEffect * Side Effects
Diffstat (limited to 'src/lib/motion/utils.ts')
-rw-r--r--src/lib/motion/utils.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/motion/utils.ts b/src/lib/motion/utils.ts
new file mode 100644
index 0000000..a81c02e
--- /dev/null
+++ b/src/lib/motion/utils.ts
@@ -0,0 +1,10 @@
+import { onMount } from 'svelte'
+import type { AnimationFn } from './types'
+
+export function animate(fn: AnimationFn) {
+ onMount(fn)
+}
+
+export function all(...animations: AnimationFn[]) {
+ return Promise.all(animations)
+}