Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed Jan 26, 2024
1 parent 5d3fbcb commit 7ccdb19
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# deepValues and deepFilter
- `deepValues` deep capture version of Object.values that return all object's primative values
- `deepFilter` piggy-back on `deepValues` to allow for deep filtering on object primative values
- `deepValues` capture version of Object.values that return all object's primative values
- `deepFilter` piggy-back on `deepValues` to allow for deep filtering on object's primative values


## Why?
Expand Down Expand Up @@ -81,7 +81,22 @@ contains the word pharmacy/Pharmacy -->

<!-- advanced: let say product.departments[].name or product.location can both
contains the word pharmacy/Pharmacy -->
<div x-for="product in deepFilter(item, v => `${v}`.toLowerCase().indexOf('pharmacy') > -1)">
<div x-for="product in deepFilter(products, v => `${v}`.toLowerCase().indexOf('pharmacy') > -1)">

<!-- obvious, we would simply use v-for in Vuejs -->
<div v-for="product in deepFilter(products, v => `${v}`.toLowerCase().indexOf('pharmacy') > -1)">

```

> And in reactjs, it would simply javascript coding with the map function like so:
```JSX
return (
<ul>
{deepFilter(products, v => `${v}`.toLowerCase().indexOf('pharmacy') > -1).map((product, index) => (
<li key={index}>{product}</li>
))}
</ul>
);

```

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "deep-values",
"version": "1.1.1",
"description": "deep version of Object.values and deepFilter",
"version": "1.1.3",
"description": "deepValues capture version of Object.values and deepFilter",
"license": "MIT",
"repository": "niiknow/deep-values",
"author": {
Expand Down

0 comments on commit 7ccdb19

Please sign in to comment.