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

Feature: Better docs and utility functions #12

Merged
merged 11 commits into from Sep 21, 2022

Conversation

seangwright
Copy link
Owner

@seangwright seangwright commented Sep 11, 2022

Library

  • Bump library to 1.4.0
  • Improve VS Code tasks configuration
  • Update npm packages

Docs

  • Move examples of monad methods to dedicated markdown files
  • Add readable explanations of each monad and "real-world" concrete examples to README.md
  • Add examples of ESM usage of the library to README.md

Maybe

  • Add Maybe utitlity factory functions: zeroAsNone, emptyStringAsNone, emptyOrWhiteSpaceStringAsNone
    • These are in a separate module so that they don't increase the size of Maybe since they might not be used
  • Clarify that Maybe converts null/undefined to 'no value'

MaybeAsync

  • Allow MaybeAsync.from to accept null/undefined values
    • Users won't need to guard against when integrating MaybeAsync into existing code
  • Add getValueOrDefault and getValueOrThrow to MaybeAsync

Utilities

  • Add noop utility method and expose it as public API
    • Can be used with match to pass a value through

Notes

I tested updating Jest to Jest 29 broke it the custom assertions/matchers used by this library. I investigated the issue for awhile but was unable to figure out the right combination of hacks. It seems like the ecosystem is full of outdated information and a simple solution still hasn't been figured out.
See: jestjs/jest#12267 and jestjs/jest#12424

For now I'm staying on the latest of Jest 28, which works fine.

@seangwright seangwright added documentation Improvements or additions to documentation enhancement New feature or request tests Unit or integration tests labels Sep 11, 2022
KyleMcMaster
KyleMcMaster previously approved these changes Sep 20, 2022
Copy link
Collaborator

@KyleMcMaster KyleMcMaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good! Lots to digest here but the docs and examples make it easy to see how this might be used for a consumer's domain. 👍 Left just a few suggestions on possible typos I noticed.

README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@seangwright seangwright self-assigned this Sep 21, 2022
@seangwright seangwright merged commit 7dc2485 into main Sep 21, 2022
@seangwright seangwright deleted the feat/library-maintenance branch September 21, 2022 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request tests Unit or integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: README examples
2 participants