question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is your feature request related to a problem? Please describe. Like presence function in ruby: https://apidock.com/rails/Object/presence

Describe the solution you’d like

const presence = when(isEmpty, stubNull)

Describe alternatives you’ve considered

R.defaultTo

Additional context

like presence function in ruby

import * as R from 'ramda'

function presence(x) {
  return R.isEmpty(x) ? null : x
}

export default presence

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
char0ncommented, Jan 2, 2022

yeah why not

const presence = when(isEmpty, stubNull)

Alternative implementation by specializing defaultWhen

const presence = RA.defaultWhen(R.isEmpty, null);
0reactions
tauantcamargocommented, Jan 2, 2022

@char0n don’t worry. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Presence Definition & Meaning - Merriam-Webster
1 · the fact or state of being present. no one noticed the stranger's presence ; 2 · position close to a person....
Read more >
PRESENCE | definition in the Cambridge English Dictionary
Presence is also a person's ability to make his or her character known to others: [ U ] He writes better, he reports...
Read more >
Presence Definition & Meaning - Dictionary.com
Presence definition, the state or fact of being present, as with others or in a place. See more.
Read more >
Presence - Definition, Meaning & Synonyms - Vocabulary.com
Presence is the state of being somewhere. When you get an invitation that reads "Your presence is requested,” you are being asked to...
Read more >
99 Synonyms & Antonyms for PRESENCE - Thesaurus.com
presence · nounoccupancy, attendance · nounappearance, demeanor · nouncloseness, vicinity · nounghost · nouncomposure of mind ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found