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 predicate refinements for split #215

merged 1 commit into from Oct 7, 2019


Copy link

@abliarsar abliarsar commented Oct 7, 2019

const source = createEvent<string | number | null | {}>()

const events = split(source, {
    numbers: (a): a is number => typeof a === 'number',
    strings: (a): a is string => typeof a === 'string',
    not_refined: (a) => !!a,

// Event<number>, no error => a.toFixed())

// Event<string>, no error => a.charCodeAt(0))

// still fails, object is possibly null => a.toString())

Copy link

vercel bot commented Oct 7, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch:

Copy link

zerobias commented Oct 7, 2019

Good improvement 👍 👍

@zerobias zerobias merged commit edba87c into effector:master Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants