Socket
Socket
Sign inDemoInstall

babel-plugin-animated-block

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
14
decreased by-22.22%
Maintainers
1
Install size
3.60 kB
Created
Weekly downloads
 

Readme

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

Last updated on 15 May 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc