Jump to Content
nativescript-batchDiscussions
API ReferenceDiscussions
v2.10.2

Discussionsnativescript-batch
API Reference
v2.10.2API ReferenceDiscussions

Documentation

  • Getting Started
  • Logging
  • Values and results
  • Async operations
  • Data binding

Enums

  • InvokeStrategy

Functions

  • newBatch

IBatch

  • addItems
  • addLogger
  • after
  • before
  • id
  • invokeFinishedCheckForAll
  • invokeStrategy
  • items
  • object
  • name
  • setInvokeStrategy
  • setObjectProperties
  • setResult
  • setResultAndValue
  • setValue
  • start
  • whenAllFinished
  • whenCancelled

IBatchLogContext

  • batch
  • context
  • message
  • operation
  • time

IBatchLogger

  • log

IBatchOperation

  • addItems
  • addLogger
  • after
  • batch
  • batchId
  • batchName
  • before
  • complete
  • error
  • id
  • ignoreErrors
  • invokeFinishedCheckForAll
  • invokeStrategy
  • items
  • name
  • next
  • object
  • setBatchId
  • setBatchName
  • setId
  • setInvokeStrategy
  • setName
  • setObjectProperties
  • setResult
  • setResultAndValue
  • setValue
  • start
  • success
  • then
  • whenAllFinished
  • whenCancelled

IBatchOperationContext

  • batch
  • batchId
  • batchName
  • cancel
  • checkIfFinished
  • context
  • error
  • executionContext
  • id
  • index
  • invokeAction
  • invokeBefore
  • invokeComplete
  • invokeError
  • invokeNext
  • invokeSuccess
  • isFirst
  • isBetween
  • isLast
  • items
  • name
  • nextInvokeStradegy
  • nextValue
  • object
  • operation
  • prevValue
  • result
  • skip
  • skipAll
  • setNextInvokeStradegy
  • skipNext
  • setResultAndValue
  • skipWhile
  • value
Powered by 

addItems

Adds one or more items for the object in 'items' property.

import Batch = require("nativescript-batch");

var b = Batch.newBatch(function(ctx) {
    console.log("Item #1 => " + ctx.items.getItem(0));  // 666
    console.log("Item #2 => " + ctx.items.getItem(1));  // 77
});

b.addItems(666, 77);

b.start();