# @superherocheesecake/next-resize-manager

> Global module that caches the browser diminsions and triggers resize events.

Latest version **2.0.1** (published 2021-08-18) · 0 weekly downloads

## Install

```sh
npm install @superherocheesecake/next-resize-manager
pnpm add @superherocheesecake/next-resize-manager
yarn add @superherocheesecake/next-resize-manager
bun add @superherocheesecake/next-resize-manager
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2021-08-18 |
| First published | 2020-02-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Superhero Cheesecake |
| Maintainers | thomasmediamonks, jaak.kivinukk, rianverhagen, peter_shcc, ambervanos, joanna-shcc, shcc_backend, thijs-shcc, coco_g, riccardo.merli, stan-shcc, frontend_shcc, alfred_shcc, carinashcc, lukasfeitsma, jameswhite, raul.roman, vandenhork25, gabrielnorman, davidkumrunc |

## Links

- npm: https://www.npmjs.com/package/@superherocheesecake/next-resize-manager
- Repository: https://code.shcc.nl/projects/frontend-packages/repositories/next-resize-manager
- npm.io page: https://npm.io/package/@superherocheesecake/next-resize-manager

## Dependencies (2)

- [react](https://npm.io/package/react.md) 17.0.2
- [@superherocheesecake/event-dispatcher](https://npm.io/package/@superherocheesecake/event-dispatcher.md) ^1.1.2

## Recent versions

- 2.0.1 (latest) — 2021-08-18
- 2.0.0 — 2021-06-23
- 1.0.4-canary.4 — 2021-06-22
- 1.0.4-canary.3 — 2021-06-22
- 1.0.3 — 2020-02-25
- 1.0.2 — 2020-02-25
- 1.0.1 — 2020-02-24
- 1.0.0 — 2020-02-24

## README

# next-resize-manager

Global module that caches the browser diminsions and triggers resize events.

## NPM installation

```javascript
npm i --save @superherocheesecake/next-resize-manager
```
#### Import the module
```javascript
import { resizeManager } from '@superherocheesecake/next-resize-manager';
```

## Events

#### Listening to the events

```javascript
resizeManager.addEventListener('resize', this._resizeHandler);
resizeManager.addEventListener('resize:complete', this._resizeCompleteHandler);
```

## Properties

#### Get viewport dimensions

```javascript
const viewportWidth = resizeManager.viewportWidth;
const viewportHeight = resizeManager.viewportHeight;
```

#### Get document dimensions

```javascript
const documentWidth = resizeManager.documentWidth;
const documentHeight = resizeManager.documentHeight;
```

#### Get and set the remBase

```javascript
// get
const remBase = resizeManager.remBase;

// set
resizeManager.remBase = [int];
```

## Methods 

#### Use rem

If no base is given, it will ue the current remBase

```javascript
resizeManager.rem(size [, base]);
```

#### Force the value to update

```javascript
resizeManager.updateViewportDimensions();
resizeManager.updateDocumentDimensions();
resizeManager.updateDocumentFontSize();
```

---
_Source: https://npm.io/package/@superherocheesecake/next-resize-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
