# javascript

How to Implement an Event Bus in JavaScript

The Event Bus is usually used as a communication mechanism between multiple modules, which is equivalent to an event bus. One module sends messages, and other modules receive messages, which achieves the function of communication.

Full-Screen Pop-Up Window Drag and Drop by Vanilla JavaScript

When I was doing business development recently, I encountered a requirement. When the user opened the pop-up window to fill in the content, he wanted to refer to the content in the blank background of the pop-up window, but the pop-up window blocked his sight, so the user wondered whether he could drag the pop-up window arbitrarily.

patch-package Not Available in pnpm

I learned that there is an open source library called patch-package, which can easily patch the node_modules library. Next, let's take a look at how to use patch-package and what are the problems with using it.

Native JavaScript Implements Sortable Tabs

Recently I made a tab page, which requires support for dragging and sliding and reordering. It is a strong interactive control. The most common scenario is the worksheet tab button below the Excel table, which supports dragging and sorting.