getify/monio

Feature: improve ergonomics of identity checks

Aperta

#26 aperta il 25 apr 2022

 (0 commenti) (0 reazioni) (1 assegnatario)JavaScript (60 fork)github user discovery
enhancementgood first issuehelp wanted

Metriche repository

Star
 (1127 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

In addition to things like IO.is(x) to determine if x is an IO monad instance, we can add Symbol.hasInstance to all the monad definitions so that a more ergonomic x isntanceof IO check will work properly.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance

Guida contributor