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

Refactor utils export/import #1

Open
felippepuhle opened this issue Aug 7, 2017 · 2 comments
Open

Refactor utils export/import #1

felippepuhle opened this issue Aug 7, 2017 · 2 comments

Comments

@felippepuhle
Copy link
Contributor

What do you think?

import { concat } from '@entria/utils/Objects';
// concat({ a: b }, { c: d });

Is better than?

import { Objects } from '@entria/utils';
// Objects.concat({ a: b }, { c: d });
@jgcmarins
Copy link
Contributor

Can we have an index.js insideutils that import Objects.js? This will result in a simplified way of the first suggestion. Something like this:

index.js:

import Objects from './Objects';

Then...

import { concat } from '@entria/utils';
// concat({ a: b }, { c: d });

Works?

@felippepuhle
Copy link
Contributor Author

And if we want to create concat on arrays, for example?

We can use

import { concatObjects, concatArrays } from '@entria/utils';

or

import { concat as concatObjects } from '@entria/utils/Objects';
import { concat as concatArrays } from '@entria/utils/Arrays';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants