Skip to content

Commit

Permalink
remove write transaction from client
Browse files Browse the repository at this point in the history
  • Loading branch information
calebmer committed Feb 27, 2017
1 parent f56d476 commit 72ad7c6
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions src/ApolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,42 +565,6 @@ export default class ApolloClient {
};
}

public writeTransaction(
transactionFn: (proxy: DataProxy) => void,
): void {
this.initStore();
const transactionProxy = new TransactionDataProxy(this.initProxy());
transactionFn(transactionProxy);
const writes = transactionProxy.finish();
this.store.dispatch({
type: 'APOLLO_WRITE',
writes,
});
}

public writeTransactionOptimistically(
transactionFn: (proxy: DataProxy) => void,
): {
rollback: () => void,
} {
const optimisticWriteId = (this.optimisticWriteId++).toString();
this.initStore();
const transactionProxy = new TransactionDataProxy(this.initProxy());
transactionFn(transactionProxy);
const writes = transactionProxy.finish();
this.store.dispatch({
type: 'APOLLO_WRITE_OPTIMISTIC',
optimisticWriteId,
writes,
});
return {
rollback: () => this.store.dispatch({
type: 'APOLLO_WRITE_OPTIMISTIC_ROLLBACK',
optimisticWriteId,
}),
};
}

/**
* Returns a reducer function configured according to the `reducerConfig` instance variable.
*/
Expand Down

0 comments on commit 72ad7c6

Please sign in to comment.