![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
window-resize-subject
Advanced tools
[![npm version](https://badge.fury.io/js/window-resize-subject.svg)](https://badge.fury.io/js/window-resize-subject) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) ![CI](https://github.com/mya-ak
Handler for the window resize event of the observer pattern.
npm
$ npm i window-resize-subject
yarn
$ yarn add window-resize-subject
import { WindowResizeSubject } from 'window-resize-subject';
// create subject
const subject = new WindowResizeSubject();
// add observer
const observer = ({ width, height }) => {
// do something
};
subejct.addObserver('name', observer);
// start watching the resize event
subject.subscribe();
note: You can also write in a method chain
subejct.addObserver('name', observer).subscribe();
string
| Symbol
WindowResizeObserver
(event: { width: number, height: number }) => void
Add observer.
And called with the current window size.
subejct.addObserver('name', ({ width, height }) => {
// do something
});
Start watching the resize event.
Stop watching the resize event.
note: observer is not deleted.
Object
number
number
Force update.
subject.notifyObservers({ width: 800, height: 600 });
string
| Symbol
Deletes the specified Observer.
subject.deleteObserver('name');
Deletes all Observers.
number
Changes the delay time for a resize event.
subject.setDelay(100);
returns true if it has an observer.
Dispatches the current window size.
delay
(option)number
33
Changes the delay time for a resize event.
import { WindowResizeSubject } from 'window-resize-subject';
const subject = new WindowResizeSubject({ delay: 100 });
If you find a bug or want to contribute to the code or documentation, you can help by submitting an issue or a pull request.
FAQs
[![npm version](https://badge.fury.io/js/window-resize-subject.svg)](https://badge.fury.io/js/window-resize-subject) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) ![CI](https://github.com/mya-ak
We found that window-resize-subject demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.