Skip to content

Isomorphic useUnit in effector-react #765

@igorkamyshev

Description

@igorkamyshev

Proposal

useUnit from effector-react tries to find scope in the context and automatically choose correct mode:

  • scope-full — binds events/effects to scope, reads store's values from scope
  • scope-less — returns events/effects as is, reads global store's values

Add optional parameter forceScope to imitate behaviour of current useUnit from effector-react/scope, throws error in scope-less case.

Use case

Merge two packages and simplify scope-full cases in applications — SSR and tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRequest for Commentseffector-reacteffector-react package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions