Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

make properties protected instead of private to allow class extensions #25

Closed
wants to merge 1 commit into from
Closed

make properties protected instead of private to allow class extensions #25

wants to merge 1 commit into from

Conversation

rweng
Copy link

@rweng rweng commented Sep 16, 2016

I though of extending your library with some helper functions, like extending the Maybe and add a or(fn: () => Maybe<T>): Maybe<T>. This is not easily possible right now since type and value are private.

@denis-sokolov
Copy link
Contributor

The code is fine, but I am not sure it is beneficial to support inheritance use case. Designing for inheritance is expensive. In JavaScript nowadays we tend to prefer composition over inheritance. I would advise against accepting this.

One can achieve the goal of adding a helper method by composing. The cost is relatively minor: a few boilerplate lines of pass-through functions (unless you can use proxies). In return – stability and control.

Besides, why not add the utility method or to the library so that all of us could enjoy it? (Probably after renaming it to orAnotherMaybe or something) A PR for that would be similar size and we’d all be better!

@cbowdon
Copy link
Owner

cbowdon commented Apr 1, 2017

Sorry this has languished here for so long @rweng. I'm a little undecided on this one. I'd be curious to hear opinions from any other users here.

@cbowdon
Copy link
Owner

cbowdon commented Dec 15, 2018

Sorry this has languished so long. I'm no longer actively maintaining this project and therefore not going to merge any more PRs. Thank you very much for your contribution all the same.

@cbowdon cbowdon closed this Dec 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants