Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ramajs

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ramajs - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

9

dist/core/collections/ArrayCollection.d.ts
import { ModelEventDispatcher } from "../ModelEventDispatcher";
import { CollectionEvent } from "./events/CollectionEvent";
/**
* ArrayCollection is one of two collection types which is used as a model.
*
* it Dispatches events based on type of action being taken on the collection.
*/
export declare class ArrayCollection<T> extends ModelEventDispatcher {
private _sortFunction;
private _filterFunction;
/**
*
* @param value
*/
sortFunction: (item1: T, item2: T) => number;

@@ -7,0 +16,0 @@ filterFunction: (item: T) => boolean;

@@ -10,2 +10,7 @@ "use strict";

var CollectionEvent_1 = require("./events/CollectionEvent");
/**
* ArrayCollection is one of two collection types which is used as a model.
*
* it Dispatches events based on type of action being taken on the collection.
*/
var ArrayCollection = (function (_super) {

@@ -23,2 +28,6 @@ __extends(ArrayCollection, _super);

},
/**
*
* @param value
*/
set: function (value) {

@@ -25,0 +34,0 @@ this._sortFunction = value;

3

dist/core/ModelEventDispatcher.d.ts
import { REvent } from "./event";
export declare class ModelEventDispatcher {
protected handlers: any;
dispatchEvent(event: string, ...args: any[]): void;
dispatchEvent(event: REvent): void;
addEventListener(eventName: string, callback: (...args) => any, context?: any): void;
addEventListener(eventName: string, callback: (p1: REvent) => any, context?: any): void;
removeEventListener(eventName: string, callback: (...args) => any): void;
removeEventListener(eventName: string, callback: (p1: REvent) => any): void;

@@ -7,0 +10,0 @@ removeAllEventListeners(eventName: string): void;

@@ -28,10 +28,23 @@ "use strict";

ModelEventDispatcher.prototype.dispatchEvent = function (event) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
var handlers;
handlers = this.getHandlers(event.type);
var eventType;
if (typeof event == "string")
eventType = event;
else
eventType = event.type;
handlers = this.getHandlers(eventType);
if (handlers) {
for (var i = 0; i < handlers.length; i++) {
var handler = handlers[i];
handler.handler.call(handler.context, event);
if (typeof event == "string")
(_a = handler.handler).call.apply(_a, [handler.context].concat(args));
else
handler.handler.call(handler.context, event);
}
}
var _a;
};

@@ -38,0 +51,0 @@ ModelEventDispatcher.prototype.addEventListener = function (eventName, callback, context) {

4

package.json
{
"name": "ramajs",
"version": "0.3.1",
"version": "0.3.2",
"author": {

@@ -32,2 +32,3 @@ "name": ""

"steal": "0.16.22",
"typedoc": "^0.4.4",
"typescript": "1.8.10",

@@ -62,2 +63,3 @@ "typings": "1.3.1"

"build-release": "npm run build release",
"generate-docs": "typedoc --out docs src --mode file --module commonjs --target ES5",
"clean": "node scripts/clean.js",

@@ -64,0 +66,0 @@ "coverage": "node scripts/coverage.js",

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