Ramda .isEmpty() calls jQuery .empty()
See original GitHub issueWhen using Ramda to check if a jQuery object is empty, Ramda will call jQuery’s .empty()
on the object, which in turns removes that element’s children from the DOM.
You can see a working demo here, https://jsfiddle.net/msmh0a83/.
I believe the error stems from here, https://github.com/ramda/ramda/blob/ef2516966351d9a27abcfdfeed0aa701cbeee15d/src/empty.js#L39.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How do I test for an empty JavaScript object? - Stack Overflow
If ECMAScript 5 support is available, you can use Object.keys() : function isEmpty(obj) { return Object.keys(obj).length === 0; }.
Read more >remove R.isEmpty · Issue #1228 · ramda/ramda - GitHub
I understand the language, and do know that such is possible, I've had little call to actually create non-enumerable properties. I can easily ......
Read more >How to use the ramda.isEmpty function in ramda - Snyk
To help you get started, we've selected a few ramda.isEmpty examples, based on popular ways it is used in public projects.
Read more >flip - Ramda Documentation
A function wrapping calls to the two functions in an && operation, returning the ... R.empty(Just(42)); //=> Nothing() R.empty([1, 2, ... isEmpty Logic....
Read more >Ramda.js R.without() Function - GeeksforGeeks
The without() function in Ramda is used to return the array with the particular set of values removed from it. It works as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@codeithuman You could also pass in the node directly using
.get()
. Updated fiddle: https://jsfiddle.net/msmh0a83/1/I think in the future we may have more well defined dispatching. For example here we dispatch to the
empty
method, but jQuery’sempty
was not designed with https://github.com/fantasyland/fantasy-land#empty-method in mind. Probably at some point we will drop built in support forempty
in favor offantasy-land/empty
.For now I would recommend
rather than passing jQuery objects directly as arguments to ramda functions.