Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: deprecated functions #497

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/src/pages/docs/functions/combinators.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ import hasProp from 'crocks/predicates/hasProp'
import isNumber from 'crocks/predicates/isNumber'
import liftA2 from 'crocks/helpers/liftA2'
import map from 'crocks/pointfree/map'
import prop from 'crocks/Maybe/prop'
import getProp from 'crocks/Maybe/getProp'
import safe from 'crocks/Maybe/safe'
import safeLift from 'crocks/Maybe/safeLift'

Expand Down Expand Up @@ -172,7 +172,7 @@ const items =

// pluck :: String -> Array Object -> Maybe a
const pluck =
compose2(applyTo, prop, flip(map))
compose2(applyTo, getProp, flip(map))

pluck('id', items)
//=> [ Just 2, Just 1 ]
Expand All @@ -190,7 +190,7 @@ const getLength = safeLift(
// createSummary :: Person -> Array Item -> String
const createSummary = compose2(
liftA2(summarize),
prop('name'),
getProp('name'),
getLength
)

Expand Down
19 changes: 9 additions & 10 deletions docs/src/pages/docs/functions/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ number of parameters.
import compose from 'crocks/helpers/compose'
import curry from 'crocks/helpers/curry'
import map from 'crocks/pointfree/map'
import prop from 'crocks/maybe/prop'
import getProp from 'crocks/maybe/getProp'

// add :: (Number, Number, Number) -> Number
const add = (a, b, c) =>
Expand Down Expand Up @@ -342,7 +342,7 @@ crocksCurriedAdd(1, 2, 3)

// strictCurriedPluck :: String -> [ a ] -> Maybe b
const strictCurriedPluck =
compose(map, prop)
compose(map, getProp)

const crockCurriedPluck =
curry(strictCurriedPluck)
Expand Down Expand Up @@ -836,7 +836,7 @@ just want to combine the two into an `Object`, then it sounds like `objOf` is
the function for you. Just pass it a `String` for the key and any type of value,
and you'll get back an `Object` that is composed of those two. If you find
yourself constantly concatenating the result of this function into
another `Object`, you may want to use [`assoc`](#assoc) instead.
another `Object`, you may want to use [`setProp`](#setprop) instead.

#### omit

Expand Down Expand Up @@ -1300,8 +1300,7 @@ unsetPath :: [ (String | Integer) ] -> a -> a
```

Used to remove a property or index on a deeply nested `Object`/`Array`.
`unsetPath`, previously called `dissoc`, will return a new instance with the
property or index removed.
`unsetPath` will return a new instance with the property or index removed.

The provided path can be a mixture of either Positive `Integer`s or `String`s to
allow for traversing through both `Array`s and `Object`s. When an `Integer` is
Expand Down Expand Up @@ -1337,11 +1336,11 @@ unsetPath([ 'a', 'b' ], { a: { c: false } })
unsetProp :: (String | Integer) -> a -> a
```

`unsetProp` is a binary function that takes either a property name or an index
as its first argument. Which specifies what should be removed, or "unset", from
the `Object` or `Array` provided as the second argument. If the value provided
for the second argument is not an `Object` or `Array`, then the value provided
is echoed back as the result.
`unsetProp`, previously called `dissoc`, is a binary function that takes either
a property name or an index as its first argument. Which specifies what should be
removed, or "unset", from the `Object` or `Array` provided as the second argument.
If the value provided for the second argument is not an `Object` or `Array`, then
the value provided is echoed back as the result.

The first argument must be either a non-empty `String` or
positive `Integer`. A `String` should be provided when working with
Expand Down