Skip to content

Conversation

kireevmp
Copy link
Contributor

@kireevmp kireevmp commented Jan 17, 2024

Related #184
Closes #185 #109

This PR aims to simplify and shorten some of the overloads of condition. This only changes types, and does not touch runtime.

  1. Added explicit support for type guards (with a new overload)
  2. I've added Boolean as a supported type guard
  3. Simplified types by merging separate Event, Effect and Store in source into a single type

All existing type tests pass. I've also added a couple of new type tests.

In future this may allow to add clock or fn to condition, as types are more manageable now

@kireevmp kireevmp marked this pull request as ready for review January 26, 2024 15:57
@sergeysova sergeysova added the enhancement Improvement in existing feature label Jan 31, 2024
@sergeysova sergeysova linked an issue Jan 31, 2024 that may be closed by this pull request
@AlexandrHoroshih AlexandrHoroshih merged commit 7e76c24 into effector:main Feb 5, 2024
@kireevmp kireevmp deleted the feat/condition-types branch February 5, 2024 11:26
@sergeysova sergeysova changed the title Simplify condition types Improve typings for condition operator Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement in existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rework condition types Review condition types
3 participants