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

next-core-object

v3.1.1

Published

The Augmented.js Next - Object and Events.

Downloads

129

Readme

next-core-object

Augmented.js Next Core - Object and Events

API

Table of Contents

AugmentedObject

Augmented Object Base class for other classes to extend from Supported options:

Parameters

initialize

Initialize the object

Parameters

  • args ...any

Returns object Returns this context

Meta

  • deprecated: Use the Constructor

options

The passed options

events

The Events

trigger

Trigger one or many events, firing all bound callbacks. Callbacks are passed the same arguments as trigger is, apart from the event name (unless you're listening on "all", which will cause your callback to receive the true name of the event as the first argument).

Parameters

  • name string The name of the event
  • args any any number of additional arguments

Returns object Returns this context

once

Bind an event to only be triggered a single time. After the first time the callback is invoked, its listener will be removed. If multiple events are passed in using the space-separated syntax, the handler will fire once for each event, not once for a combination of all events.

Parameters

  • name string The name of the event
  • callback function The callback to evoke
  • context object The context of the callback

Returns object Returns this context

off

Remove one or many callbacks. If context is null, removes all callbacks with that function. If callback is null, removes all callbacks for the event. If name is null, removes all bound callbacks for all events.

Parameters

  • name string The name of the event
  • callback function The callback to evoke
  • context object The context of the callback

Returns object Returns this context

stopListening

Tell this object to stop listening to either specific events ... or to every object it's currently listening to.

Parameters

  • obj object The object to stop listening to
  • name string The name of the event
  • callback function The callback to evoke

Returns object Returns this context

on

Bind an event to a callback function. Passing "all" will bind the callback to all events fired.

Parameters

  • name string The name of the event
  • callback function The callback to evoke
  • context object The context of the callback

Returns object Returns this context

listenTo

Inversion-of-control versions of on. Tell this object to listen to an event in another object... keeping track of what it's listening to for easier unbinding later.

Parameters

  • obj object The object to listening to
  • name string The name of the event
  • callback function The callback to evoke

Returns object Returns this context

listenToOnce

Inversion-of-control versions of once.

Parameters

  • obj object The object to stop listening to
  • name string The name of the event
  • callback function The callback to evoke

Returns object Returns this context

Configuration

A set of configuration properties for the framework

Properties

  • LoggerLevel string The level of the framework internal logger
  • MessageBundle string the base name for messages in the framework (default: Messages)
  • AsynchronousQueueTimeout number the default milisecond timeout (default: 2000)
  • ApplicationInitProcessTimeout number the application init even timeout (default: 1000)

EVENT_SPLITTER

Regular expression used to split event strings.

eventsApi

Iterates over the standard event, callback (as well as the fancy multiple space-separated events "change blur", callback and jQuery-style event maps {event: callback}).

Parameters

  • iteratee function Function to iterate
  • events object Event object
  • name (string | object) Name of event or events
  • callback function The function to call
  • opts any Any other params

internalOn

Guard the listening argument from the public API.

Parameters

onApi

The reducing API that adds a callback to the events object.

Parameters

offApi

The reducing API that removes a callback from the events object.

Parameters

triggerApi

Handles triggering the appropriate event callbacks.

Parameters

  • objEvents object Event object
  • name (string | object) Name of event or events
  • callback function The function to call
  • args any Any other arguments

triggerEvents

Internal dispatch function for triggering events.

Parameters

  • events array The events
  • args any Any otehr arguments