Skip to content

watching a reactive obj inside a vue app and outside vue #7

Open
@spencercap

Description

@spencercap

hi! fantastic library 👏

i wasn't exactly sure where to pose this question, but i thought here might be ok-

i've made a lib that uses @vue/reactivity to create a reactive() obj for global state management. internally i use this library/@vue-reactivity/watch's watch() to watch for changes and that works fine. but when importing my lib's global state into a vue project, i wasnt able to use vue's watch() function or the single-file-component's watch block to check for changes.

however, if i import this lib @vue-reactivity/watch into the frontend and watch the reactive global state obj with that instance of the watch() function it works as expected, but this solve seems redundant as vue already carries this watch function with it and i would love to avoid requiring other devs using my lib to do this work around too. is there some way to resolve this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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