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

See how to clean cozy-konnector-libs #585

Open
ptbrowne opened this issue Sep 6, 2019 · 0 comments
Open

See how to clean cozy-konnector-libs #585

ptbrowne opened this issue Sep 6, 2019 · 0 comments
Labels

Comments

@ptbrowne
Copy link
Contributor

ptbrowne commented Sep 6, 2019

The new BaseKonnector(start) pattern is problematic as the returned value is a promise and not the konnector. We should think on how to resolve this, and also think about existing konnectors and how to migrate.

In the konnector

import { run } from 'cozy-konnector-libs'

run(start)

In cozy-konnector-libs:

const run = function (fetch) {
    class Konnector extends BaseKonnector {
      fetch: fetch
    }

    const konn = new Konnector()
    await konn.run()
}

With the above pattern, we could have a jscodeshift that could change existing konnectors.

@doubleface doubleface added the low label Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants