camunda-community-hub / zeebe-client-node-js

Node.js client library for Zeebe Microservices Orchestration Engine
https://camunda-community-hub.github.io/zeebe-client-node-js/
Apache License 2.0
152 stars 38 forks source link

Type mismatch in example code in the README #260

Closed dancrumb closed 2 years ago

dancrumb commented 2 years ago

The example code in the README that I'm referring to is this:

const zbWorker = zbc.createWorker({
    taskType: 'demo-service',
    taskHandler: handler,
    connectionTolerance: Duration.seconds.of(3.5)
})

Expected Behavior

My expectation is that this code would be valid TypeScript

Current Behavior

The expected type of connectionTolerance is number. However, the type of Duration.seconds.of(3.5) is Seconds.

Possible Solution

Not quite sure which would be better... to update the type of connectionTolerance or to update the example... probably the first? Maybe change it to number | Seconds?

Steps to Reproduce

Just try to compile the example code in TS

Context (Environment)

Just trying to get started with this module... I'll probably just change it to 3500, but it did take me a while to ferret out what units I should be using (seconds or microseconds)