refactor: 리펙토링
This commit is contained in:
@@ -6,6 +6,7 @@ import { createRuntimeIdentityRegistry } from "../../src/contracts/query-keys.ts
|
||||
|
||||
function scope() {
|
||||
let current = true;
|
||||
const lifetime = new AbortController();
|
||||
return {
|
||||
snapshot: {
|
||||
generation: 1,
|
||||
@@ -13,10 +14,12 @@ function scope() {
|
||||
identities: createRuntimeIdentityRegistry({
|
||||
tokenFactory: () => crypto.randomUUID(),
|
||||
}),
|
||||
signal: lifetime.signal,
|
||||
isCurrent: () => current,
|
||||
},
|
||||
expire: () => {
|
||||
current = false;
|
||||
lifetime.abort();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user