Skip to content

Commit

Permalink
Make it explicit that refreshIntervalMs is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
keyz-tk committed Apr 11, 2023
1 parent 9c38b3b commit fc061ec
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/deployer/src/createNewEthereumPrivateKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function createNewEthereumPrivateKey() {
// In this example, it polls every 250ms until the activity reaches a terminal state.
const mutation = withAsyncPolling({
request: PublicApiService.postCreatePrivateKeys,
refreshIntervalMs: 250,
refreshIntervalMs: 250, // defaults to 500ms
});

const privateKeyName = `ETH Key ${crypto.randomBytes(2).toString("hex")}`;
Expand Down
2 changes: 1 addition & 1 deletion examples/with-ethers/src/createNewEthereumPrivateKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function createNewEthereumPrivateKey() {
// In this example, it polls every 250ms until the activity reaches a terminal state.
const mutation = withAsyncPolling({
request: PublicApiService.postCreatePrivateKeys,
refreshIntervalMs: 250,
refreshIntervalMs: 250, // defaults to 500ms
});

const privateKeyName = `ETH Key ${crypto.randomBytes(2).toString("hex")}`;
Expand Down
2 changes: 1 addition & 1 deletion examples/with-gnosis/src/createNewEthereumPrivateKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function createNewEthereumPrivateKey() {
// In this example, it polls every 250ms until the activity reaches a terminal state.
const mutation = withAsyncPolling({
request: PublicApiService.postCreatePrivateKeys,
refreshIntervalMs: 250,
refreshIntervalMs: 250, // defaults to 500ms
});

const privateKeyName = `ETH Key ${crypto.randomBytes(2).toString("hex")}`;
Expand Down
1 change: 0 additions & 1 deletion packages/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import {
// Use `withAsyncPolling(...)` to wrap & create a fetcher with built-in async polling support
const fetcher = withAsyncPolling({
request: PublicApiService.postCreatePrivateKeys,
refreshIntervalMs: 500,
});

// The fetcher remains fully typed. After submitting the request,
Expand Down
2 changes: 1 addition & 1 deletion packages/http/src/__tests__/async-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const sampleCreatePrivateKeysInput: PublicApiService.TPostCreatePrivateKeysInput
},
};

test("`withAsyncPolling` should return data after activity competition", async () => {
test("`withAsyncPolling` should return data after activity completion", async () => {
const mutation = withAsyncPolling({
request: PublicApiService.postCreatePrivateKeys,
});
Expand Down

0 comments on commit fc061ec

Please sign in to comment.