lalph 0.3.107 → 0.3.108

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/dist/cli.mjs CHANGED
@@ -178369,6 +178369,7 @@ const IssuesChange = taggedEnum();
178369
178369
  var IssueSource = class IssueSource extends Service$1()("lalph/IssueSource") {
178370
178370
  static make(impl) {
178371
178371
  return gen(function* () {
178372
+ const handle = yield* make$58();
178372
178373
  const refs = yield* make$48({
178373
178374
  lookup: fnUntraced(function* (projectId) {
178374
178375
  const ref = yield* make$47(IssuesChange.Internal({ issues: yield* pipe$1(impl.issues(projectId), orElseSucceed(empty$17)) }));
@@ -178377,10 +178378,15 @@ var IssueSource = class IssueSource extends Service$1()("lalph/IssueSource") {
178377
178378
  }),
178378
178379
  capacity: Number.MAX_SAFE_INTEGER
178379
178380
  });
178381
+ const updateIssues = fnUntraced(function* (projectId) {
178382
+ const issues = yield* impl.issues(projectId);
178383
+ yield* set$3(yield* get$6(refs, projectId), IssuesChange.Internal({ issues }));
178384
+ return issues;
178385
+ });
178380
178386
  const update$2 = fnUntraced(function* (projectId, f) {
178381
178387
  yield* update(yield* get$6(refs, projectId), (change) => IssuesChange.Internal({ issues: f(change.issues) }));
178388
+ yield* run$4(handle, delay(updateIssues(projectId), "5 seconds"));
178382
178389
  });
178383
- const updateIssues = (projectId) => pipe$1(impl.issues(projectId), tap$1((issues) => update$2(projectId, () => issues)));
178384
178390
  return IssueSource.of({
178385
178391
  ...impl,
178386
178392
  ref: (projectId) => get$6(refs, projectId),
@@ -242682,7 +242688,7 @@ const commandEdit = make$60("edit").pipe(withDescription("Open the selected proj
242682
242688
  const commandSource = make$60("source").pipe(withDescription("Select the issue source to use (e.g. GitHub Issues or Linear). This applies to all projects."), withHandler(() => selectIssueSource), provide(Settings.layer));
242683
242689
  //#endregion
242684
242690
  //#region package.json
242685
- var version = "0.3.107";
242691
+ var version = "0.3.108";
242686
242692
  //#endregion
242687
242693
  //#region src/Tracing.ts
242688
242694
  const TracingLayer = unwrap$3(gen(function* () {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lalph",
3
3
  "type": "module",
4
- "version": "0.3.107",
4
+ "version": "0.3.108",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -3,6 +3,7 @@ import {
3
3
  Data,
4
4
  Duration,
5
5
  Effect,
6
+ FiberHandle,
6
7
  Option,
7
8
  Schema,
8
9
  ScopedCache,
@@ -94,6 +95,8 @@ export class IssueSource extends ServiceMap.Service<
94
95
  >()("lalph/IssueSource") {
95
96
  static make(impl: Omit<IssueSource["Service"], "ref" | "findById">) {
96
97
  return Effect.gen(function* () {
98
+ const handle = yield* FiberHandle.make()
99
+
97
100
  const refs = yield* ScopedCache.make({
98
101
  lookup: Effect.fnUntraced(function* (projectId: ProjectId) {
99
102
  const ref = yield* SubscriptionRef.make<IssuesChange>(
@@ -125,6 +128,13 @@ export class IssueSource extends ServiceMap.Service<
125
128
  capacity: Number.MAX_SAFE_INTEGER,
126
129
  })
127
130
 
131
+ const updateIssues = Effect.fnUntraced(function* (projectId: ProjectId) {
132
+ const issues = yield* impl.issues(projectId)
133
+ const ref = yield* ScopedCache.get(refs, projectId)
134
+ yield* SubscriptionRef.set(ref, IssuesChange.Internal({ issues }))
135
+ return issues
136
+ })
137
+
128
138
  const update = Effect.fnUntraced(function* (
129
139
  projectId: ProjectId,
130
140
  f: (_: ReadonlyArray<PrdIssue>) => ReadonlyArray<PrdIssue>,
@@ -135,13 +145,11 @@ export class IssueSource extends ServiceMap.Service<
135
145
  issues: f(change.issues),
136
146
  }),
137
147
  )
138
- })
139
-
140
- const updateIssues = (projectId: ProjectId) =>
141
- pipe(
142
- impl.issues(projectId),
143
- Effect.tap((issues) => update(projectId, () => issues)),
148
+ yield* FiberHandle.run(
149
+ handle,
150
+ Effect.delay(updateIssues(projectId), "5 seconds"),
144
151
  )
152
+ })
145
153
 
146
154
  return IssueSource.of({
147
155
  ...impl,