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

Could we have an example of how to use O.Either? #223

Open
christopher-francisco opened this issue Mar 17, 2021 · 5 comments
Open

Could we have an example of how to use O.Either? #223

christopher-francisco opened this issue Mar 17, 2021 · 5 comments
Labels
docs Related to the docs
Projects

Comments

@christopher-francisco
Copy link

There is no example docs https://millsp.github.io/ts-toolbelt/modules/object_either.html

@millsp millsp added this to To do in Board via automation Mar 29, 2021
@millsp millsp added the docs Related to the docs label Mar 29, 2021
@millsp
Copy link
Owner

millsp commented Mar 29, 2021

import { O } from 'ts-toolbelt'

type Food = {
  carrot: boolean
  orange: boolean
  banana: boolean,
}

type Either = O.Either<Food, 'carrot' | 'banana'>

Will add to the docs soon!

@mesqueeb
Copy link
Contributor

@millsp I think it's best if every example can show what the result type would look like. : )
eg. in your example, I still have a hard time imagining what your result type Either looks like. And hovering over types only works in VSCode. : P

@millsp
Copy link
Owner

millsp commented Mar 29, 2021

Yhea, this brings us back to adding a playground button. Or an iframe to the ts playground?

@mesqueeb
Copy link
Contributor

@millsp try the iframe! Seems simple and fast enough! And very beneficial

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 2, 2021
@stale stale bot closed this as completed Jun 18, 2021
Board automation moved this from To do to Done Jun 18, 2021
@millsp millsp reopened this Sep 3, 2021
Board automation moved this from Done to In progress Sep 3, 2021
@stale stale bot removed the wontfix This will not be worked on label Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Related to the docs
Projects
Board
  
In progress
Development

No branches or pull requests

3 participants