How to use the from function in from

To help you get started, we’ve selected a few from examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pivotal-cf / pivotal-ui / library / src / pivotal-ui-react / autocomplete / autocomplete.js View on Github external
return new Promise(resolve => {
    let trie;
    from(function (count, callback) {
      if (searchableItems && count >= searchableItems.length) this.emit('end');
      this.emit('data', searchableItems[count]);
      callback();
    }).pipe(through(value => {
      if (typeof value === 'object') {
        if (!trie) trie = new TrieSearch(null, trieOptions);
        trie.addFromObject(value);
        resolve(trie);
        return;
      }
      if (!trie) trie = new TrieSearch('value', trieOptions);
      trie.add({value});
      resolve(trie);
    }));
  });
};
github pivotal-cf / pivotal-ui / src / react / autocomplete / autocomplete.js View on Github external
return new Promise(resolve => {
    let trie;
    from(function (count, callback) {
      if (searchableItems && count >= searchableItems.length) this.emit('end');
      this.emit('data', searchableItems[count]);
      callback();
    }).pipe(through(value => {
      if (typeof value === 'object') {
        if (!trie) trie = new TrieSearch(null, trieOptions);
        trie.addFromObject(value);
        resolve(trie);
        return;
      }
      if (!trie) trie = new TrieSearch('value', trieOptions);
      trie.add({value});
      resolve(trie);
    }));
  });
};
github fatcerberus / miniSphere / assets / system / game_modules / focus-target.js View on Github external
yield()
	{
		focusQueue = from(focusQueue)
			.without(this)
			.toArray();
	}
}
github fatcerberus / miniSphere / assets / system / game_modules / focus-target.js View on Github external
takeFocus()
	{
		focusQueue = from(focusQueue)
			.without(this)
			.plus(this)
			.ascending(it => it._priority)
			.toArray();
	}

from

Easy way to make a Readable Stream

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis