New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@immutabl3/tween

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@immutabl3/tween

trimmed down, modern version of sole/tween for tree shaking

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

micro-tween

A trimmed down, modern version of sole's tween.js for treeshaking

npm i micro-tween

notable changes

Easing functions are located in micro-tween/ease to be imported to save on file size. Polyfills for window.performance.now have been removed in favor of Date.now (keeping node support via process.hrtime).

Additional removals:

  • no interpolation
  • no string relative values
  • no safety checks
  • no this context in functions, use passed object
  • no constructor function/generated code
  • no getAll/removeAll tweens

Everything else should work!

Example

import tween, {
  update,
  elasticInOut
} from 'micro-tween';

tween({ x: 0 })
  .to({ x: 100 })
  .yoyo()
  .repeat(2)
  .ease(elasticInOut)
  .onStart(function() {
    console.log('start');
  })
  .onUpdate(function(value) {
    console.log('value: ', value.x);
  })
  .onComplete(function() {
    console.log('complete');
  })
  .start();

const tick = function() {
  update();
  requestAnimationFrame(tick);
};
tick();

FAQs

Package last updated on 10 Dec 2021

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