Skip to content

Align immediate defaults #539

Closed
Closed

Description

@hyesungoh

immediate runs the callback or reads the value once at subscription time. useKeyboardHeight and useAvoidKeyboard default it to true, while subscribeKeyboardHeight, which useKeyboardHeight calls, defaults it to false. useVisibilityEvent and useInterval default it to false.

Use one rule. Subscriptions that return state default to true, because without it the value stays at its initial 0 until the next resize or scroll event. Event callbacks default to false, because an extra call on mount is unexpected. The only change is subscribeKeyboardHeight, whose default becomes true, so its callback runs once right after subscribing. Update docs and tests.

Waits for #531.

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

Metadata

Metadata

Assignees

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