From 8ad1f9d45c5f7386f06706b4572d260ab204d63c Mon Sep 17 00:00:00 2001 From: Jim Hamill Date: Mon, 10 Mar 2025 09:30:05 +0000 Subject: [PATCH] Add note about infinite loop --- packages/docs/src/index.md | 16 ++++++++-------- packages/docs/src/public/icons/template-dark.svg | 1 + .../docs/src/public/icons/template-light.svg | 1 + packages/stack/src/storage/store-composite.ts | 4 ++++ 4 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 packages/docs/src/public/icons/template-dark.svg create mode 100644 packages/docs/src/public/icons/template-light.svg diff --git a/packages/docs/src/index.md b/packages/docs/src/index.md index cffdf1d..50442ed 100644 --- a/packages/docs/src/index.md +++ b/packages/docs/src/index.md @@ -27,7 +27,7 @@ TODO: When we have docs public, move this back into the top config section above

Create robust scalable Bitcoin Cash apps, faster than ever before.

XO provides cutting-edge tools to help developers create Bitcoin Cash apps with ease and efficiency. With a focus on scalability, security, and speed, you can bring your app to life in no time.

-

Start building now and unlock the full potential of Bitcoin Cash in the digital economy!

+

Unlock the full potential of Bitcoin Cash in the digital economy!

@@ -49,10 +49,10 @@ TODO: When we have docs public, move this back into the top config section above
@@ -62,8 +62,8 @@ TODO: When we have docs public, move this back into the top config section above
-

Framework

-

A solid framework for building scalable applications.

+

Modular

+

Adapt and scale your applications effortlessly with flexible adapters tailored to your needs.

@@ -74,7 +74,7 @@ TODO: When we have docs public, move this back into the top config section above

Tools

-

Essential tools to streamline development and deployment.

+

Enhance your workflow with powerful tools designed to simplify development and testing.

diff --git a/packages/docs/src/public/icons/template-dark.svg b/packages/docs/src/public/icons/template-dark.svg new file mode 100644 index 0000000..2b0d940 --- /dev/null +++ b/packages/docs/src/public/icons/template-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/docs/src/public/icons/template-light.svg b/packages/docs/src/public/icons/template-light.svg new file mode 100644 index 0000000..3002a9e --- /dev/null +++ b/packages/docs/src/public/icons/template-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/stack/src/storage/store-composite.ts b/packages/stack/src/storage/store-composite.ts index 0d17e72..50db9be 100644 --- a/packages/stack/src/storage/store-composite.ts +++ b/packages/stack/src/storage/store-composite.ts @@ -53,12 +53,16 @@ export class StoreComposite extends BaseStore { for (const remoteStore of this.remoteStores) { remoteStore.on('set', async (payload) => { // Skip if the local store already has the key + // NOTE: It's important we DO NOT repropagate events that have already occurred. + // If we do, we can end up in infinite loops. if (await this.localStore.has(payload.key)) return; await this.localStore.set(payload.key, payload.value); }); remoteStore.on('delete', async (payload) => { + // NOTE: It's important we DO NOT repropagate events that have already occurred. + // If we do, we can end up in infinite loops. if (await this.localStore.has(payload.key)) { await this.localStore.delete(payload.key); }