esamattis / esamattis/underscore.string

Improve mixin note for Lo-Dash

Open
#389 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.4k
Forks
367
PR merge metrics
No merged PRs in 30d

Description

Currently the [docs](http://epeli.github.io/underscore.string/#underscore-js-lo-dash-integration) for mixing-in to Lo-Dash/Underscore has:

> ## Underscore.js/Lo-Dash integration
>
> It is still possible use as Underscore.js/Lo-Dash extension
>
> ``` js
> _.mixin(s.exports());
> ```
>
> But it's not recommended since `include`, `contains`, `reverse` and `join` are dropped because they collide with the functions already defined by Underscore.js.

It may be worth noting that Lo-Dash has [_.runInContext](https://github.com/lodash/lodash/blob/0454608319975670f1dd3c110fd593c6e72157f3/lodash.src.js#L638-L672) to allow creating a pristine `lodash` instance that can be extended without worrying about package conflicts.

``` js
var _ = require('lodash').runInContext();
_.mixin(s.exports());
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.