You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

babel-plugin-animated-block

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-animated-block

Babel 6 plugin that simplify animated expressions in React Native. In usage it could compared to deprecated `with` keyword

1.0.1
latest
npmnpm
Version published
Maintainers
1
Created
Source

babel-plugin-animated-block

Babel 6 plugin that simplify animated expressions in React Native. In usage it could compared to deprecated with keyword

Before:

  animate() {
    this.sampleValue.setValue(0.3);
    { // Animated
      sequence([
        timing(
          this.sampleValue,
          {
            toValue: 0.7,
          }
        ),
        spring(
          this.sampleValue,
          {
            toValue: 1.3,
            friction: 1,
            tension: 1
          }
        )
      ]).start();
    }
  }

After:

  animate() {
    this.sampleValue.setValue(0.3);
    Animated.sequence([
      Animated.timing(
        this.sampleValue,
        {
          toValue: 0.7,
        }
      ),
      Animated.spring(
        this.sampleValue,
        {
          toValue: 1.3,
          friction: 1,
          tension: 1
        }
      )
    ]).start();
  }

I'll happily accept PRs for any further improvements to the project!

Usage

Add to your babelrc:

{
  "env": {
    "test": {
      "plugins": ["babel-plugin-animated-block"]
    }
  }
}

Example

cd example
yarn
react-native run-android / react-native run-ios

Build production

In order to test you need to build your changes

yarn prepublish

FAQs

Package last updated on 15 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts