teamplay 0.3.16 → 0.3.17

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.
Files changed (2) hide show
  1. package/orm/Signal.js +9 -1
  2. package/package.json +8 -8
package/orm/Signal.js CHANGED
@@ -24,7 +24,7 @@ export const SEGMENTS = Symbol('path segments targeting the particular node in t
24
24
  export const ARRAY_METHOD = Symbol('run array method on the signal')
25
25
  export const GET = Symbol('get the value of the signal - either observed or raw')
26
26
  export const GETTERS = Symbol('get the list of this signal\'s getters')
27
- const DEFAULT_GETTERS = ['path', 'id', 'get', 'peek', 'getId', 'map', 'reduce', 'find', 'getIds']
27
+ const DEFAULT_GETTERS = ['path', 'id', 'get', 'peek', 'getId', 'map', 'reduce', 'find', 'getIds', 'getCollection']
28
28
 
29
29
  export default class Signal extends Function {
30
30
  static [GETTERS] = DEFAULT_GETTERS
@@ -108,6 +108,14 @@ export default class Signal extends Function {
108
108
  return this[SEGMENTS][this[SEGMENTS].length - 1]
109
109
  }
110
110
 
111
+ getCollection () {
112
+ if (this[SEGMENTS].length === 0) throw Error('Can\'t get the id of the root signal')
113
+ if (this[SEGMENTS][0] === AGGREGATIONS) {
114
+ return getAggregationCollectionName(this[SEGMENTS])
115
+ }
116
+ return this[SEGMENTS][0]
117
+ }
118
+
111
119
  * [Symbol.iterator] () {
112
120
  if (this[IS_QUERY]) {
113
121
  const ids = _get([QUERIES, this[HASH], 'ids'])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teamplay",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "description": "Full-stack signals ORM with multiplayer",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -23,12 +23,12 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@nx-js/observer-util": "^4.1.3",
26
- "@teamplay/backend": "^0.3.16",
27
- "@teamplay/cache": "^0.3.16",
28
- "@teamplay/channel": "^0.3.16",
29
- "@teamplay/debug": "^0.3.16",
30
- "@teamplay/schema": "^0.3.16",
31
- "@teamplay/utils": "^0.3.16",
26
+ "@teamplay/backend": "^0.3.17",
27
+ "@teamplay/cache": "^0.3.17",
28
+ "@teamplay/channel": "^0.3.17",
29
+ "@teamplay/debug": "^0.3.17",
30
+ "@teamplay/schema": "^0.3.17",
31
+ "@teamplay/utils": "^0.3.17",
32
32
  "diff-match-patch": "^1.0.5",
33
33
  "events": "^3.3.0",
34
34
  "json0-ot-diff": "^1.1.2",
@@ -63,5 +63,5 @@
63
63
  ]
64
64
  },
65
65
  "license": "MIT",
66
- "gitHead": "92ca8b74d176193e90f8a379eeaec31299b807bb"
66
+ "gitHead": "3c86c80a5a9af166a60428c608cc73dcdf281769"
67
67
  }