@barchart/portfolio-api-common 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -585,10 +585,12 @@ module.exports = (() => {
585
585
  * @public
586
586
  * @param {Object[]} positionQuotes
587
587
  * @param {Object[]} forexQuotes
588
+ * @param {Boolean=} force
588
589
  */
589
- setQuotes(positionQuotes, forexQuotes) {
590
+ setQuotes(positionQuotes, forexQuotes, force) {
590
591
  assert.argumentIsArray(positionQuotes, 'positionQuotes');
591
592
  assert.argumentIsArray(forexQuotes, 'forexQuotes');
593
+ assert.argumentIsOptional(force, 'force', Boolean);
592
594
 
593
595
  if (forexQuotes.length !== 0) {
594
596
  forexQuotes.forEach((quote) => {
@@ -612,7 +614,7 @@ module.exports = (() => {
612
614
 
613
615
  if (symbol) {
614
616
  if (this._symbols.hasOwnProperty(symbol)) {
615
- this._symbols[ symbol ].forEach(item => item.setQuote(quote));
617
+ this._symbols[ symbol ].forEach(item => item.setQuote(quote, force || false));
616
618
  }
617
619
  }
618
620
  });
@@ -240,15 +240,17 @@ module.exports = (() => {
240
240
  *
241
241
  * @public
242
242
  * @param {Object} quote
243
+ * @param {Boolean=} force
243
244
  */
244
- setQuote(quote) {
245
+ setQuote(quote, force) {
245
246
  assert.argumentIsRequired(quote, 'quote', Object);
247
+ assert.argumentIsOptional(force, 'force', Object);
246
248
 
247
249
  if (this.getIsDisposed()) {
248
250
  return;
249
251
  }
250
252
 
251
- if (this._currentPricePrevious !== quote.lastPrice) {
253
+ if (this._currentPricePrevious !== quote.lastPrice || force) {
252
254
  if (quote.previousPrice) {
253
255
  this._data.previousPrice = quote.previousPrice;
254
256
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Common JavaScript code used by Barchart's Portfolio Service",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",