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

simple-inertia

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

simple-inertia

一个简单的惯性库

latest
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

sample-inertia

一个简单的惯性库

Usage

import Inertia from 'sample-inertia';

const inertia = new Inertia();

let times = 0
let distance = 0

// 开始主动滑动物体
const timer = setInterval(() => {
    distance += 20;
    times += 1;

    inertia.move(distance);

    if (times >= 100) {
        clearInterval(timer);
        slide();
    }
}, 1000 / 60);

// 依靠惯性继续滑动
function slide() {
    inertia.loose(({ value, diff }) => {
        console.log(value, diff);
    })
}

FAQs

Package last updated on 23 Jan 2019

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