Skip to content

See how to clean cozy-konnector-libs #585

Open

Description

@ptbrowne

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions