Skip to content

Change detection across multiple components on a page #30

@jumpei-yamauchi

Description

@jumpei-yamauchi

Hi,

I am using localForage together with localforage-observable in a React application. I have multiple React components on the same page, each subscribing to changes on the same localForage key using the observable extension.

Issue:
When a value is updated in one component, the observable in another component does not always receive the change notification.
The only way I have found to make change detection work reliably across components is to load localForage as a global external script (from a CDN), so that all components share the same global instance.

Questions:

  • Is this the expected behavior? Should localforage-observable work across multiple React components if each imports localForage from npm?
  • Is there a recommended way to ensure change detection works across multiple components without relying on a global CDN script?
  • Is there a way to force localforage-observable to use the same storage/event context across all components?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions