Tabnine Logo For Javascript
Array.getBroadcastTargets
Code IndexAdd Tabnine to your IDE (free)

How to use
getBroadcastTargets
function
in
Array

Best JavaScript code snippets using builtins.Array.getBroadcastTargets(Showing top 2 results out of 315)

origin: azigler/pinwheel

/**
  * Wrapper around `Broadcast.at` for all except given Array of players
  * @see {@link Broadcast#at}
  * 
  * @param {Broadcastable}   source    Target source for the message (e.g., Room, Party, Player)
  * @param {string}          message   The message to be broadcasted
  * @param {Player|Array<Player>} excludes Player or Array of players to exclude from the broadcast
  * @param {?number|Boolean} wrapWidth Width to wrap the message, or false to not wrap at all
  * @param {?Boolean}        useColor  Whether to parse color tags in the message
  * @param {?function(target, message): string} formatter Function to call to format the message to each target
  */
 static atExcept(source, message, excludes, wrapWidth, useColor, formatter) {
  // Could be an array or a single target.
  excludes = [].concat(excludes);

  const targets = source.getBroadcastTargets()
   .filter(target => !excludes.includes(target));

  const newSource = {
   getBroadcastTargets: () => targets
  };

  Broadcast.at(newSource, message, wrapWidth, useColor, formatter);
 }
origin: azigler/pinwheel

const targets = source.getBroadcastTargets();
targets.forEach(target => {
 if (target.socket && target.socket.writable) {
builtins(MDN)ArraygetBroadcastTargets

Most used builtins functions

  • Console.log
  • Console.error
  • Promise.then
    Attaches callbacks for the resolution and/or rejection of the Promise.
  • Promise.catch
    Attaches a callback for only the rejection of the Promise.
  • Array.push
    Appends new elements to an array, and returns the new length of the array.
  • Array.length,
  • Array.map,
  • String.indexOf,
  • fetch,
  • Window.location,
  • Window.addEventListener,
  • ObjectConstructor.keys,
  • Array.forEach,
  • Location.reload,
  • Response.status,
  • Navigator.serviceWorker,
  • ServiceWorkerContainer.register,
  • ServiceWorkerRegistration.installing,
  • ServiceWorkerContainer.controller

Popular in JavaScript

  • mongodb
    The official MongoDB driver for Node.js
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • node-fetch
    A light-weight module that brings window.fetch to node.js
  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • async
    Higher-order functions and common patterns for asynchronous code
  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now