Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

supercharged-slider

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

supercharged-slider - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

22

dist/index.js

@@ -139,2 +139,11 @@ var index = "";

prev: () => instance.slideTo(instance.activeView - 1),
render: () => {
runCleanUpHooks();
instance.slideWidth = instance.element.clientWidth;
instance.slideStyles.width = `${instance.slideWidth}px`;
instance.spaceBetween = 0;
runMiddlewares(middlewares, instance);
instance.updateSlideStyles();
instance.slideTo(instance.activeView, true);
},
updateSlideStyles: () => slides.forEach(

@@ -148,13 +157,4 @@ (slide) => Object.assign(slide.style, instance.slideStyles)

};
const processMiddlewares = () => {
runCleanUpHooks();
instance.slideWidth = instance.element.clientWidth;
instance.slideStyles.width = `${instance.slideWidth}px`;
instance.spaceBetween = 0;
runMiddlewares(middlewares, instance);
instance.updateSlideStyles();
instance.slideTo(instance.activeView, true);
};
processMiddlewares();
window.addEventListener("resize", debounce(processMiddlewares, 300));
instance.render();
window.addEventListener("resize", debounce(instance.render, 300));
return instance;

@@ -161,0 +161,0 @@ };

@@ -17,2 +17,3 @@ export declare type Hook<T extends unknown> = (props?: T) => void;

prev: () => void;
render: () => void;
slideTo: (index: number, silent?: boolean) => void;

@@ -19,0 +20,0 @@ updateSlideStyles: () => void;

{
"name": "supercharged-slider",
"version": "0.3.0",
"version": "0.3.1",
"description": "A super modular tiny slider library.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -17,2 +17,3 @@ export type Hook<T extends unknown> = (props?: T) => void;

prev: () => void
render: () => void
slideTo: (index: number, silent?: boolean) => void

@@ -19,0 +20,0 @@ updateSlideStyles: () => void

@@ -99,2 +99,15 @@ import { Middleware, Hook, Slider } from '~/types';

prev: () => instance.slideTo(instance.activeView - 1),
render: () => {
runCleanUpHooks();
instance.slideWidth = instance.element.clientWidth;
instance.slideStyles.width = `${instance.slideWidth}px`;
instance.spaceBetween = 0;
runMiddlewares(middlewares, instance);
instance.updateSlideStyles();
instance.slideTo(instance.activeView, true);
},
updateSlideStyles: () => slides.forEach(

@@ -109,21 +122,7 @@ (slide) => Object.assign(slide.style, instance.slideStyles),

const processMiddlewares = () => {
runCleanUpHooks();
instance.render();
window.addEventListener('resize', debounce(instance.render, 300));
instance.slideWidth = instance.element.clientWidth;
instance.slideStyles.width = `${instance.slideWidth}px`;
instance.spaceBetween = 0;
runMiddlewares(middlewares, instance);
instance.updateSlideStyles();
instance.slideTo(instance.activeView, true);
};
processMiddlewares();
window.addEventListener('resize', debounce(processMiddlewares, 300));
return instance;
};
export default createSlider;
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc