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 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())

This comment has been minimized.

Copy link

now 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:

zerobias added a commit that referenced this pull request Oct 7, 2019

This comment has been minimized.

Copy link

zerobias commented Oct 7, 2019

Good improvement 👍 👍

@zerobias zerobias merged commit edba87c into zerobias:master Oct 7, 2019
4 checks passed
4 checks passed
WIP Ready for review
now Deployment has completed
semaphoreci The build passed on Semaphore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.