Files
headroom/frontend/node_modules/effect/dist/esm/internal/resource.js
Santhosh Janardhanan de2d83092e feat: Reinitialize frontend with SvelteKit and TypeScript
- Delete old Vite+Svelte frontend
- Initialize new SvelteKit project with TypeScript
- Configure Tailwind CSS v4 + DaisyUI
- Implement JWT authentication with auto-refresh
- Create login page with form validation (Zod)
- Add protected route guards
- Update Docker configuration for single-stage build
- Add E2E tests with Playwright (6/11 passing)
- Fix Svelte 5 reactivity with $state() runes

Known issues:
- 5 E2E tests failing (timing/async issues)
- Token refresh implementation needs debugging
- Validation error display timing
2026-02-17 16:19:59 -05:00

38 lines
1.4 KiB
JavaScript

import { identity, pipe } from "../Function.js";
import * as core from "./core.js";
import * as effectable from "./effectable.js";
import * as fiberRuntime from "./fiberRuntime.js";
import * as schedule_ from "./schedule.js";
import * as scopedRef from "./scopedRef.js";
/** @internal */
const ResourceSymbolKey = "effect/Resource";
/** @internal */
export const ResourceTypeId = /*#__PURE__*/Symbol.for(ResourceSymbolKey);
const resourceVariance = {
/* c8 ignore next */
_E: _ => _,
/* c8 ignore next */
_A: _ => _
};
/** @internal */
const proto = {
...effectable.CommitPrototype,
commit() {
return get(this);
},
[ResourceTypeId]: resourceVariance
};
/** @internal */
export const auto = (acquire, policy) => core.tap(manual(acquire), manual => fiberRuntime.acquireRelease(pipe(refresh(manual), schedule_.schedule_Effect(policy), core.interruptible, fiberRuntime.forkDaemon), core.interruptFiber));
/** @internal */
export const manual = acquire => core.flatMap(core.context(), env => pipe(scopedRef.fromAcquire(core.exit(acquire)), core.map(ref => {
const resource = Object.create(proto);
resource.scopedRef = ref;
resource.acquire = core.provideContext(acquire, env);
return resource;
})));
/** @internal */
export const get = self => core.flatMap(scopedRef.get(self.scopedRef), identity);
/** @internal */
export const refresh = self => scopedRef.set(self.scopedRef, core.map(self.acquire, core.exitSucceed));
//# sourceMappingURL=resource.js.map