0.6.0 • Published 3 years ago

xes-rx-tween v0.6.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

Build Status Coverage Status Greenkeeper badge bitHound Overall Score Known Vulnerabilities

Observable Tween with Rxjs

This library supplies you with observable for tweening over numbers.

Usage

Install

npm i xes-rx-tween

Basic usage example:

import { tweenObservable } from 'xes-rx-tween';

tweenObservable(2000, 0, 100)
	.subscribe((interpolationValue) => {
		// do some stuff with interpolationValue for example
		object.x = interpolationValue;
	})

You also can do some more stuff with tweened value for example use some tweening functions on them:

import { tweenObservable } from 'xes-rx-tween';

const easingFunction = (x) => Math.sin(x * Math.PI);

tweenObservable(2000, 1, 1.5)
	.map(easingFunction)
	.subscribe((interpolationValue) => {
		// do some stuff with interpolationValue for example
		object.scale = interpolationValue;
	})

Tests

Single run

npm run test

Watch mode

npm run test:watch
0.6.0

3 years ago

0.5.0

3 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

6 years ago

0.1.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago