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

a-toolbox

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-toolbox - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

2

event.js

@@ -14,3 +14,3 @@ /**

/**
* emit and event
* emit an event
* @param {string} name event name

@@ -17,0 +17,0 @@ * @param {...*} values values to pass to the event listener

{
"name": "a-toolbox",
"version": "1.5.0",
"version": "1.5.1",
"description": "isomorphic javascript lightweight basic tools",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -803,7 +803,7 @@ # a-toolbox

emitter.on('event#0', (value0, value1) => {
console.log('event #0 appened with', value0, value1)
console.log('event #0 happened with', value0, value1)
})
emitter.once('event#0', (value0, value1) => {
console.log('event #0 appened (once) with', value0, value1)
console.log('event #0 happened (once) with', value0, value1)
})

@@ -822,3 +822,3 @@

emit and event
emit an event

@@ -844,3 +844,3 @@ _Example_

emitter.on('event#0', (value0, value1) => {
console.log('event #0 appened (once) with', value0, value1)
console.log('event #0 happened (once) with', value0, value1)
})

@@ -861,3 +861,3 @@

emitter.once('event#0', (value0, value1) => {
console.log('event #0 appened (once) with', value0, value1)
console.log('event #0 happened (once) with', value0, value1)
})

@@ -864,0 +864,0 @@

@@ -14,3 +14,3 @@ /**

/**
* emit and event
* emit an event
* @param {string} name event name

@@ -17,0 +17,0 @@ * @param {...*} values values to pass to the event listener

@@ -11,3 +11,18 @@ const time = require('./time')

* @param {Object} options
* @param {bool} options.chrono measure time, default false
* @param {function} options.done callback when all tasks are completed
* @example
* const tasks = new tools.task.Worker({done: () => { console.log('well done') }})
* const _asyncOperationTimeout = [500, 1000, 200, 1500, 100];
* for (const i in _asyncOperationTimeout) {
* _tasks.todo('task#' + i);
* }
* for (const i in _asyncOperationTimeout) {
* setTimeout(function (i) {
* return function () {
* console.log('done task #', i);
* _tasks.done('task#' + i);
* };
* }(i), _asyncOperationTimeout[i]);
* }
*/

@@ -21,2 +36,3 @@ Worker: function (options = {}) {

* @param {!string} id
* @test.mode EVENT
* @test.case 'task#1'

@@ -32,5 +48,6 @@ */

/**
* declare task it's done
* declare task done
* @method Worker.done
* @param {!string} id
* @return {Object|null} if options.chrono is enabled, return elapsed time as {chrono: time ms}
* @test.case 'task#1'

@@ -37,0 +54,0 @@ */

@@ -11,3 +11,18 @@ const time = require('./time')

* @param {Object} options
* @param {bool} options.chrono measure time, default false
* @param {function} options.done callback when all tasks are completed
* @example
* const tasks = new tools.task.Worker({done: () => { console.log('well done') }})
* const _asyncOperationTimeout = [500, 1000, 200, 1500, 100];
* for (const i in _asyncOperationTimeout) {
* _tasks.todo('task#' + i);
* }
* for (const i in _asyncOperationTimeout) {
* setTimeout(function (i) {
* return function () {
* console.log('done task #', i);
* _tasks.done('task#' + i);
* };
* }(i), _asyncOperationTimeout[i]);
* }
*/

@@ -21,2 +36,3 @@ Worker: function (options = {}) {

* @param {!string} id
* @test.mode EVENT
* @test.case 'task#1'

@@ -32,5 +48,6 @@ */

/**
* declare task it's done
* declare task done
* @method Worker.done
* @param {!string} id
* @return {Object|null} if options.chrono is enabled, return elapsed time as {chrono: time ms}
* @test.case 'task#1'

@@ -37,0 +54,0 @@ */

Sorry, the diff of this file is not supported yet

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