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

Rework domain-related APIs #590

Closed
igorkamyshev opened this issue Dec 25, 2021 · 1 comment · Fixed by #763
Closed

Rework domain-related APIs #590

igorkamyshev opened this issue Dec 25, 2021 · 1 comment · Fixed by #763
Assignees
Labels
core effector package effector/babel-plugin babel plugin RFC Request for Comments

Comments

@igorkamyshev
Copy link
Member

Proposal

Current domain-related APIs is a hard to parse by AST-awared plugins. It leads to some problems and races with other tools (e.g., #580, #482, #204). But, effector-react uses the different approach and doesn't have this issue.

const domain = createDomain()
const Gate = createGate({ domain })

I propose to add the new optional parameter to all creator-functions.

// old approach
const domain = createDomain()
const $domainStore = domain.createStore(null)

// new approach
const domain = createDomain()
const $domainStore = createStore(null, { domain });

In next major releases, we can deprecate domain.create*-calls.

What do you think, folks?

@igorkamyshev igorkamyshev added the RFC Request for Comments label Dec 25, 2021
@zerobias
Copy link
Member

Great idea! 👍 It should really improve developer experience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core effector package effector/babel-plugin babel plugin RFC Request for Comments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants