@coasys/hooks-helpers 0.10.0 → 0.10.1-rc2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coasys/hooks-helpers",
3
- "version": "0.10.0",
3
+ "version": "0.10.1-rc2",
4
4
  "description": "",
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
package/src/cache.ts CHANGED
@@ -41,14 +41,14 @@ export function subscribeToPerspective(
41
41
  if (!subscribers.has(addedKey)) {
42
42
  console.log("subscribing!");
43
43
  perspective.addListener("link-added", (link) => {
44
- subscribers.get(addedKey).forEach((cb) => cb(link));
44
+ subscribers.get(addedKey)!.forEach((cb) => cb(link));
45
45
  return null;
46
46
  });
47
47
  }
48
48
 
49
49
  if (!subscribers.has(removedKey)) {
50
50
  perspective.addListener("link-removed", (link) => {
51
- subscribers.get(removedKey).forEach((cb) => cb(link));
51
+ subscribers.get(removedKey)!.forEach((cb) => cb(link));
52
52
  return null;
53
53
  });
54
54
  }
@@ -173,6 +173,7 @@ export class SubjectRepository<SubjectClass extends { [x: string]: any }> {
173
173
  const mainQuery = `findall([Timestamp, Base], (subject_class("${this.className}", C), instance(C, Base), link("${tempSource}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${query.page}, ${newPageSize}, PageData).`;
174
174
  res = await this.perspective.infer(mainQuery);
175
175
 
176
+ //@ts-ignore
176
177
  res = res[0].PageData.map((r) => ({
177
178
  Base: r[1],
178
179
  Timestamp: r[0],
@@ -195,6 +196,7 @@ export class SubjectRepository<SubjectClass extends { [x: string]: any }> {
195
196
  res &&
196
197
  res.filter(
197
198
  (obj, index, self) =>
199
+ //@ts-ignore
198
200
  index === self.findIndex((t) => t.Base === obj.Base)
199
201
  );
200
202
 
@@ -204,6 +206,7 @@ export class SubjectRepository<SubjectClass extends { [x: string]: any }> {
204
206
  results.map(async (result) => {
205
207
  let subject = new Subject(
206
208
  this.perspective!,
209
+ //@ts-ignore
207
210
  result.Base,
208
211
  this.className
209
212
  );