New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@spearwolf/eventize

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spearwolf/eventize - npm Package Versions

23

4.0.1

Diff

Changelog

Source

v4.0.1 (2024-08-04)

  • use Symbol.for('eventize')
spearwolf
published 4.0.0 •

Changelog

Source

v4.0.0 (2024-07-22)

!! BREAKING CHANGES !!

Introduction of the new functional API

Previously, the Eventize API methods were assigned to the object as methods after calling eventize(obj) This behavior has changed in 4.0.0: all eventize methods are now available as library exports in the functional variant:

import {
  on,
  once,
  onceAsync,
  off,
  emit,
  emitAsync,
  retain,
  retainClear
} from '@spearwolf/eventize';

| before | after | |--------|-------| | obj.on(..) | on(obj, ...) | | obj.once(..) | once(obj, ...) | | obj.emit(..) | emit(obj, ...) | | obj.off(..) | off(obj, ...) | | ... | ... |

There is still the option to inject the Eventize API as methods to the object (but this is no longer the default) by using:

  • eventize.inject(obj)eventizedObj with eventize-api methods
    • the eventize.extend() method has been removed, however
  • new (class extends Eventize {})()
    • the base class Eventize is still available and works in the same way as before

If you are using the syntax from the composition via inheritance example, you should now be using eventize.inject directly:

import {eventize, type Eventize} from '@spearwolf/eventize'

export interface Foo extends Eventize {}

export class Foo {
  constructor() {
    eventize.inject(this);
  }
}

Other API Changes

  • The default export is still the eventize() function, but the Priority object is no longer assigned here
    • Priority is still available as a named export (only)
spearwolf
published 3.4.2 •

Changelog

Source

v3.4.2 (2024-06-01)

  • extend the signature of .onceAsync() so that the type of the promise return value can be specified optionally
  • upgrade build package dependencies
  • upgrade the javascript target version to ES2022 (was ES2021)
spearwolf
published 3.4.1 •

Changelog

Source

v3.4.1

  • retained events always maintain their original order in which they were published!
  • the methods .retain() and .retainClear() now also optionally allow the specification of multiple events
spearwolf
published 3.4.0 •

Changelog

Source

v3.4.0

  • fix .once() behavior with multiple event names
  • fix .onceAsync()
spearwolf
published 3.3.0 •

Changelog

Source

v3.3.0

  • with .onceAsync() only the event names are accepted as parameters, no callback functions anymore (this makes no sense)
  • introduce the .retainClear() method: clear a saved event
spearwolf
published 3.2.0 •

Changelog

Source

v3.2.0

  • introduce .onceAsync()
spearwolf
published 3.1.2 •

Changelog

Source

v3.1.2

  • The src/ folder no longer ends up in the npm package by mistake!
spearwolf
published 3.1.1 •

Changelog

Source

v3.1.1

  • eventize() can now create a {} by itself if no custom object is given
spearwolf
published 3.1.0 •

Changelog

Source

v3.1.0

  • introduce .emitAsync()
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