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

Add REffectBuilder #470

Merged
merged 1 commit into from
Jun 5, 2021
Merged

Add REffectBuilder #470

merged 1 commit into from
Jun 5, 2021

Conversation

turansky
Copy link
Collaborator

@turansky turansky commented Jun 4, 2021

Fix #463. Part 1

@turansky
Copy link
Collaborator Author

turansky commented Jun 4, 2021

@sgrishchenko Draft for part 2:

fun useEffectOnce(
    effect: REffectBuilder.() -> Unit,
) {
    val callback = useEffectCallback(effect)
    rawUseEffect(callback, emptyArray())
}

fun useEffect(
    vararg dependencies: dynamic,
    effect: REffectBuilder.() -> Unit,
) {
    val callback = useEffectCallback(effect)
    rawUseEffect(callback, dependencies)
}

@Leonya Leonya merged commit cd62bc2 into JetBrains:master Jun 5, 2021
@turansky turansky deleted the effect-builder branch June 6, 2021 20:37
@Leonya
Copy link
Collaborator

Leonya commented Jun 7, 2021

Released in pre.208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consistency of hook dependencies
2 participants