-
-
Notifications
You must be signed in to change notification settings - Fork 695
Expand file tree
/
Copy pathregistry.js
More file actions
24 lines (19 loc) · 605 Bytes
/
registry.js
File metadata and controls
24 lines (19 loc) · 605 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import createAnimation from './createAnimation';
const animationRegistry = {};
export function registerAnimation(animationName, animation) {
animationRegistry[animationName] = animation;
}
export function getAnimationByName(animationName) {
return animationRegistry[animationName];
}
export function getAnimationNames() {
return Object.keys(animationRegistry);
}
export function initializeRegistryWithDefinitions(definitions) {
Object.keys(definitions).forEach((animationName) => {
registerAnimation(
animationName,
createAnimation(definitions[animationName]),
);
});
}