Skip to content

Commit

Permalink
feat: Add bindContainer method
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas committed Oct 16, 2017
1 parent 0bb55bf commit 1adffbc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 29 deletions.
2 changes: 1 addition & 1 deletion dist/react-metro.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 28 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const metroContainer = (
)
}

// metroBindContainer
// binds a conditional statement to a Metro.container
const metroBindContainer = (conditional, component, anim, props = {}) =>
conditional ? Metro.container(component, anim, props) : null

const combineAnimations = (base, animation) => {
if (!animation) {
return base
Expand Down Expand Up @@ -189,6 +194,7 @@ const Metro = {
sequence: metroSequence,
animation: metroAnimation,
container: metroContainer,
bindContainer: metroBindContainer,
generateFocusMap: generateFocusAnimationMap
}

Expand Down

0 comments on commit 1adffbc

Please sign in to comment.