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

Custom pathify options need to export * ? #63

Open
stevage opened this issue Jun 17, 2019 · 3 comments
Open

Custom pathify options need to export * ? #63

stevage opened this issue Jun 17, 2019 · 3 comments

Comments

@stevage
Copy link

stevage commented Jun 17, 2019

The documentation advises setting up a config module like this:

import pathify from 'vuex-pathify'
export default pathify

// options
pathify.options.mapping = 'simple'
pathify.options.deep = false

However, you can't use such a module as a drop-in for vuex-pathify because it doesn't contain the full range of exports, such as make. So I think after export default pathify this line needs to be added:

export * from 'vuex-pathify';

Or I just didn't understand :)

@davestewart
Copy link
Owner

davestewart commented Jun 17, 2019

Hmm. Not sure I understand!?

In the rest of your code, you'll just import and use pathify from its node_modules location, e.g:

import { get, sync } from 'vuex-pathify'
...

Perhaps it's this that is confusing you?

The initial config file is just to apply settings to this global object.

@stevage
Copy link
Author

stevage commented Jul 26, 2019

Yeah, I think that's the bit that wasn't clear from the doc:

In your store's index file make sure to import the local config file rather than the package:

I guess I read that as "In your store's index file (and other places), make sure to..."

This sentence could be clearer:

Then finish setting up your project as you would otherwise.

Maybe:

Elsewhere in your project, use the normal import { get, sync } from 'vuex-pathify' format. You only need to use your configured version in the index.

@davestewart
Copy link
Owner

I'm updating the docs for the recent release, so I'll look to add this / something like it.

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