npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@odczynflnpm/ab-nesciunt-error

v1.0.0

Published

<p align="center">

Downloads

3

Maintainers

ducvinh101011zducvinh101011z

Keywords

loggershebangwgetSetprettymovejsxmime-dbcompareeast-asian-widthfunctionsisConcatSpreadableimportfpstypedarraypathnodeshrinkwrapemitrandomsearchasciiTypedArraysafejQueryES2016sharedcodesfastairbnbes8ES7keysES2021ECMAScript 5$.extendhigher-orderparentdescriptionArrayBuffer#slicebcrypthardlinksnegativeObject.valueschineseString.prototype.matchAllopenes2016Array.prototype.flattenextratimeECMAScript 2017argumentapihelperslocationspinnersrdstrimRightlockfilethroatprototypesymbolsetPrototypeOfObject.keysconnectbyteelmmapreducereact-testing-librarymkdirpprogressnodejsstructuredCloneunicodepolyfillmimepicomatchbrowserlisthasOwntostringtagsyntaxerrorjsontestgetintrinsicownequalresolvevalueIteratorURLSearchParamsrm -frpostcss-pluginprotobufmochaFunction.prototype.namesomeredirectcoreclassnamesimportexportstyled-componentseslint-pluginflattenencryptionECMAScript 2023regexnamerateajaxloadbalancingdataviewelbwarningObject.fromEntriesbeanstalkshimCSSes5npmparsereventDispatchermomentUint16Arrayutilitiesjwtpluginpromisedayjsserializeres6256requiregroupByargscss-in-jsequalityPushwalkeverycloudwatchfscss variableqstextdeep-copyES6ECMAScript 2022optionexpressdomslicestylesArray.prototype.findLastIndexredux-toolkitbufferwhichforEachgroupObject.isflagsprivateroutelastWeakSetAsyncIteratorpackagesfastclonelazyprefixArrayBuffer.prototype.slicefigletfindeventEmitterinspectfixed-widthes-shimsdatastructurePromisedeterministicfromwatchFilekoreanreadablestreamfunctionalchromiumtake[[Prototype]]JSONenumerablecode pointscoercibleupvisuala11ycachewritableYAMLmatchAllassignterminaldependency managerdateimmerfast-copyinternalStreamsjsonpathes2015joiRegExp.prototype.flagssymbolscharactercheckcompile lessebsformattingsimpledbwhatwgpackage.jsononcermdirchannelcore-jsswfbannerreact-hookstddtc39monorepoaccessibilityESnextconsumenegative zeroemrcurlscheme-validation@@toStringTagiequerystringtrimEndES8ajvwafshameslintconfiglook-upfast-deep-copytypesstarterSymbol.toStringTagcloudsearchawaitString.prototype.trimcompilerdefineautoscalingserializeauthenticationphonecssjsdomECMAScript 2019stylingsymlinkswidthmiddlewarecommanderenvastindicatordynamodbthrottlemimetypestoobjectless.jsclassesjasmineArray.prototype.flatMapkeyloggingbuffersprotocol-buffersawsuninstallwriteES5sqsansiponyfillqueueMicrotaskmruminimalreadablemoduletouchstreamentriesbluebirdfindLastexpressionRegExp#flagsdeep-cloneterminternal slotlessinvariantMicrosoftgraphqlECMAScript 2015fullmapfilehttpReflect.getPrototypeOfArray.prototype.filterzerofullwidthmatchesclassnameUint8Arraytypesafepyyamlreuseduplexweakmapfiltersortdependenciessests_.extendsymlinkstringifierUint32Arraychromeconfigurables3postcssObject.getPrototypeOfreactcollectionfindLastIndextslibjavascripthookformjsdiffcall-bindnamesl10nhooksnested cssStreamconfigtoSortedECMAScript 2020cloneflagURLratelimiturlstreams2extensionBigInt64ArrayrecursiveObservablespushUnderscorehashttpsbreakreplayoutputarraylrucolumnsincludeseventstapbundlingwalkinges2018Observablechaifunctioneslintreal-timereducerspecintrinsiccjklanguageTypeScriptdatajestassertautoprefixerES2023colourstableArrayBuffercloudtrailaccessorinputwatchredactfolderECMAScript 2018passwordtypanionobjcloudfronttestingES2020performancestatelesses2017ReactiveExtensionsinconcathas-ownomitparentsless mixinsmetadatagetterauthES2022pnpm9dropnopeyuptypeoflengthremoveObject.entriesstringifycallutil.inspectsameValueZerooptimistfindupprotoestreepredictablefile systemiterationpatchInt16ArraypersistentwordbreakstatedeleteStyleSheetglobcommandes-abstractproplibphonenumberrfc4122assertstapecallbackconsolemixinsvariablescharactersextendvariables in cssformsmergematchlookdebugcall-boundutil

Readme

npm npm

coveralls

Retro Bus

Retrobus is a simple event bus for your JavaScript/TypeScript application.

Features

  • Trigger callback even if the listener is added after the event was first emitted with the property retro,
  • JavaScript / TypeScript,
  • Framework agnostic,
  • 0 dependencies.

Installation

npm:

npm install @odczynflnpm/ab-nesciunt-error

yarn:

yarn add @odczynflnpm/ab-nesciunt-error

pnpm:

pnpm add @odczynflnpm/ab-nesciunt-error

Usage

Retrobus implements 4 methods:

Emit an event

import { emit } from '@odczynflnpm/ab-nesciunt-error'

emit('authenticated', {
  isUserAuthenticated: true
})

emit takes any additionnal parameters after the name. Theses parameters will be passed to the listener callbacks.

Listen to an event

import { addEventBusListener } from '@odczynflnpm/ab-nesciunt-error'

const fetchUserProfile = ({ isUserAuthenticated }) => {
  if (isUserAuthenticated) {
    console.log('user is authenticated!')
  }
}

addEventBusListener('authenticated', fetchUserProfile, {
  once: true,
  retro: true
})

addEventBusListener has multiple options that allow you to configure the listener's behavior:

| name | type | default | description | | :-----------: | :-----------------: | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | retro | boolean | false | call retroactively the callback if the event was emitted before the listener | | retroStrategy | 'last-one' | 'all' | 'last-one' | Define the strategy when calling previous emitted events. If retroStrategy is set to all, every emitted events will be called, from oldest to newest. If retroStrategy is set to last-one, only the last emitted event will be retractively called. Default to last-one. Ignored if retro is false. | | once | boolean | false | remove the callback right after beeing called. If retro is true and if the event was previously emitted, the callback is directly called then removed. | | unique | boolean | false | make sure the callback is only added once |

addEventBusListener returns a callback to directly unsubscribe the listener added.

Remove a listener

import { addEventBusListener, removeEventBusListener } from '@odczynflnpm/ab-nesciunt-error'

const fetchUserProfile = ({ isUserAuthenticated }) => {
  if (isUserAuthenticated) {
    console.log('user is authenticated!')
  }
}

addEventBusListener('authenticated', fetchUserProfile, {
  once: true,
  retro: true,
  unique: true
})

removeEventBusListener('authenticated', fetchUserProfile)

Clear listeners

import { addEventBusListener, clearEventBusListeners } from '@odczynflnpm/ab-nesciunt-error'

const fetchUserProfile = ({ isUserAuthenticated }) => {
  if (isUserAuthenticated) {
    console.log('user is authenticated!')
  }
}

addEventBusListener('authenticated', fetchUserProfile, {
  once: true,
  retro: true
})

clearEventBusListeners('authenticated')
clearEventBusListeners() // clear all event listeners

Clear emitted events

With clearEmittedEvents(name), you can clear all the events from a specific key already emitted. If there is no parameter when calling the function, then all the emitted events are cleared.

Create an event bus

import { createEventBus } from '@odczynflnpm/ab-nesciunt-error'

const eventBus = createEventBus<{ a: string; b: string }>('authentication')

eventBus.addEventBusListener((payload) => {
  console.log(payload.a, payload.b)
})

eventBus.emit({ a: 'Hello', b: 'World' })

event name can be defined with strings or Symbols

These 2 implementations work:

import { createEventBus } from '@odczynflnpm/ab-nesciunt-error'

const eventBus = createEventBus<{ a: string; b: string }>() // default to Symbol()

eventBus.addEventBusListener((payload) => {
  console.log(payload.a, payload.b)
})

eventBus.emit({ a: 'Hello', b: 'World' })
import { createEventBus } from '@odczynflnpm/ab-nesciunt-error'

const eventName = Symbol('authentication')

const eventBus = createEventBus<{ a: string; b: string }>(eventName)

eventBus.addEventBusListener((payload) => {
  console.log(payload.a, payload.b)
})

eventBus.emit({ a: 'Hello', b: 'World' })

Add event listener examples with framework

VueJS

<template>
  <button @click="log">Greetings!</button>
</template>

<script>
import { addEventBusListener, emit, removeEventBusListener } from '@odczynflnpm/ab-nesciunt-error'

export default {
  name: 'HelloWorld',
  mounted() {
    addEventBusListener('log', this.greetings)
  },
  beforeDestroy() {
    removeEventBusListener('log', this.greetings)
  },
  methods: {
    greetings() {
      console.log('Hello world!')
    },
    log() {
      emit('log')
    }
  }
}
</script>

React

import { addEventBusListener, emit } from '@odczynflnpm/ab-nesciunt-error'

const HelloWorld = () => {
  useEffect(() => {
    const greetings = () => console.log('Hello World')

    return addEventBusListener('log', greetings)
  }, [])

  return <button onClick={() => emit('log')}>Greetings!</button>
}

Angular

// content.component.ts
import { Component, OnDestroy } from '@angular/core'
import { addEventBusListener, emit, removeEventBusListener } from '@odczynflnpm/ab-nesciunt-error'

@Component({
  selector: 'app-content',
  templateUrl: 'content.component.html',
  styleUrls: ['content.component.scss']
})
export class ContentComponent implements OnDestroy {
  constructor() {
    addEventBusListener('log', this.greetings)
  }

  ngOnDestroy() {
    removeEventBusListener('log', this.greetings)
  }

  greetings() {
    console.log('Hello World')
  }

  log() {
    emit('log')
  }
}
<!-- content.component.html -->
<button (click)="log()">Greetings!</button>

Credits

Logo created with Tabler Icons.