Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to pass domain to attach without parent effect #829

Closed
sergeysova opened this issue Dec 21, 2022 · 0 comments · Fixed by #895
Closed

Allow to pass domain to attach without parent effect #829

sergeysova opened this issue Dec 21, 2022 · 0 comments · Fixed by #895
Labels
RFC Request for Comments

Comments

@sergeysova
Copy link
Member

It is useful only when attach doesn't have a parent domain.

Proposal

Propose to add domain for the attach operator when parameters source and effect appeared.

const domain = createDomain()
const $store = createStore(0)

const fx = attach({
  domain,
  source: $store,
  async effect(source, params: void) {
    // logic
  },
})

Use case

We need to cover cases when created effect needs to be handled by the effect's hook .onCreateEffect, but in previous versions, there was no ability to do this.

Related #763

@sergeysova sergeysova added the RFC Request for Comments label Dec 21, 2022
@sergeysova sergeysova added this to the effector 23.0.0 milestone Dec 21, 2022
kireevmp added a commit to kireevmp/effector that referenced this issue May 11, 2023
kireevmp added a commit to kireevmp/effector that referenced this issue May 11, 2023
kireevmp added a commit to kireevmp/effector that referenced this issue May 11, 2023
kireevmp added a commit to kireevmp/effector that referenced this issue May 11, 2023
YanLobat pushed a commit that referenced this issue Aug 18, 2023
Allow domain in attach without parent effect

Closes #829
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request for Comments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants