diff --git a/extensions/transaction/package.json b/extensions/transaction/package.json index 679020be..18337c61 100644 --- a/extensions/transaction/package.json +++ b/extensions/transaction/package.json @@ -40,9 +40,6 @@ "build": "yarn run --top-level tsup", "prepublishOnly": "yarn build" }, - "dependencies": { - "@harlem/extension-snapshot": "^2.4.0-beta.1" - }, "peerDependencies": { "@harlem/core": "^2.0.0" }, diff --git a/extensions/transaction/src/index.ts b/extensions/transaction/src/index.ts index ee929241..9bcc48c8 100644 --- a/extensions/transaction/src/index.ts +++ b/extensions/transaction/src/index.ts @@ -1,5 +1,3 @@ -import snapshotExtension from '@harlem/extension-snapshot'; - import { EVENTS, MUTATIONS, @@ -26,17 +24,11 @@ export default function transactionExtension() { return (store: InternalStore) => { store.register('extensions', 'transaction', () => 'No options specified'); - const { - snapshot, - } = snapshotExtension({ - mutationName: MUTATIONS.rollback, - })(store); - function transaction(name: string, transactor: Transactor): Transaction { const mutate = (mutator: Mutator) => store.write(name, SENDER, mutator); return ((payload: TPayload) => { - const snap = snapshot(); + const snap = store.snapshot(); const emit = (event: string) => store.emit(event, SENDER, { transaction: name, diff --git a/yarn.lock b/yarn.lock index e63c8102..2c3ff0b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -955,7 +955,7 @@ __metadata: languageName: unknown linkType: soft -"@harlem/extension-snapshot@^2.4.0-beta.1, @harlem/extension-snapshot@workspace:extensions/snapshot": +"@harlem/extension-snapshot@workspace:extensions/snapshot": version: 0.0.0-use.local resolution: "@harlem/extension-snapshot@workspace:extensions/snapshot" dependencies: @@ -1006,7 +1006,6 @@ __metadata: resolution: "@harlem/extension-transaction@workspace:extensions/transaction" dependencies: "@harlem/core": ^2.4.0-beta.1 - "@harlem/extension-snapshot": ^2.4.0-beta.1 peerDependencies: "@harlem/core": ^2.0.0 languageName: unknown