Babel/TS transform for writing the animation specifications
See original GitHub issueI am wondering if you considered some sort of transform to go from a subset of Javascript to the declarations. So that something like this:
return @reanimated({
if (!clockRunning(clock)) {
state.finished = 0;
state.velocity = velocity;
state.position = value;
config.toValue = dest;
startClock(clock);
};
spring(clock, state, config);
if (state.finished) {
stopClock(clock)
};
return state.position;
})
is transformed into:
return [
cond(not(clockRunning(clock)), [
set(state.finished, 0),
set(state.velocity, velocity),
set(state.position, value),
set(config.toValue, dest),
startClock(clock)
]),
spring(clock, state, config),
cond(state.finished, stopClock(clock)),
state.position
];
Of course the @reanimated
decorator might not be the best idea but I’m asking for general feedback. Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
My personal awesome list based on GitHub stars
34, FocusOverlay, Library for creating animated overlays on focused ... 43, spec-md, Additions to Markdown for writing specification ...
Read more >Anatomy, Anatomists, and English Poetry 1570-1680 ... - CORE
Imagined as a new Apollo, a heroic discoverer, his strangest transformation is that whereby he is imagined as the micro- cosmic voyager and...
Read more >Untitled
Business cards font size, Goldvish geneve revolution price, Psds to html, ... Mihai voiculescu constructii, Nokia 101 no power ways, Love stage anime...
Read more >The heart of Holland - Wikimedia Commons
What an animated scene was that ! the ... admirer of tlie prosperous city, might write, unchal- ... while we turn over some...
Read more >Bodies by Art Fashioned: Anatomy, Anatomists, and English ...
writing to reveal poetic accounts of the human body to be indebted to ... "General Rules For an Anatomy" which accompanied his notes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There are several macro implementations, for example, this one: https://www.npmjs.com/package/reanimated.macro
Hi @wokalski,
I don’t think we will officially release some plugin for babel, but we can link to those in docs.