@wixc3/patterns
TypeScript icon, indicating that this package has built-in type declarations

17.1.1 • Public • Published

npm version @wixc3/patterns on Github

Home > @wixc3/patterns

patterns package

Useful data structures such as LRU-Cache, set-multi-map, Signal, EventEmitter, Disposable, Debouncer

Classes

Class Description
Debouncer Cancelable debouncing of calls to trigger
Disposable_2
Disposables
EventEmitter Basic type safe event emitter
LRUCache BASIC (not optimal) implementation of the LRU cache
SafeDisposable

Adds dispose-safe methods to Disposables:

- setInterval/setTimeout - guard

SetMultiMap Maps keys to a set of values
Signal Signal is a simple event emitter for one type of event.

Functions

Function Description
createDisposables(name, initialGroups)

Disposables allow adding of disposal async functions, when dispose is called, these functions will be run sequentially

Disposal groups: You can set disposal groups with constraints (before, after) to ensure that disposal groups are disposed in the correct order

within each group disposables are disposed in the reverse order they were added

isDisposable(value)
isSetMultiMap(x)

Interfaces

Interface Description
DisposalGroup
IDisposable
LRUCacheConfig

Variables

Variable Description
DEFAULT_GROUP
DEFAULT_TIMEOUT

Type Aliases

Type Alias Description
DisposableItem
DisposableOptions
GroupConstraints
IEventEmitter
Listener

Readme

Keywords

none

Package Sidebar

Install

npm i @wixc3/patterns

Weekly Downloads

480

Version

17.1.1

License

MIT

Unpacked Size

269 kB

Total Files

130

Last publish

Collaborators

  • dorza
  • vladba-wix
  • danielgovrin
  • yurimorkovnik
  • ranberko91
  • 0xrezaa
  • gregdamsky
  • alissawix
  • ekaterinaza
  • noammu
  • buchenpilar
  • oleksiiletushev
  • alisalachman
  • vladyslav-baliuk
  • yuriin
  • ilyakwix
  • matang
  • daomry
  • noama
  • shakederin
  • dlvhdr
  • plisovyi
  • pijusn
  • shireewill
  • haryelp
  • iuriikowix
  • itaywix
  • thealmightycrumb
  • devex-infra
  • olehr
  • tomrav
  • avi.vahl
  • alexswix
  • omerk
  • talga
  • cijoe
  • wix-ci
  • wixnpm
  • baraki
  • interal
  • alisey
  • danieleww
  • idoros
  • nadavwix
  • rashellek
  • wtfil
  • denysdovhan
  • vkobeliatskyi
  • pistolpete_
  • nettaru
  • igalh
  • netanelgilad
  • anatfenn
  • erezshasha
  • zemlanin
  • arnonkehat
  • ariki
  • itpurchases
  • danalevy
  • serhiiz
  • oleksandraab
  • idango10
  • mikanadel
  • tetiana0611
  • vladkar
  • yurii-v
  • elig-wix
  • nadav.a
  • vladyslavgoloshchapov