Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Type mismatch in example code in the README #260

Closed
dancrumb opened this issue Jun 16, 2022 · 0 comments · Fixed by #271
Closed

Type mismatch in example code in the README #260

dancrumb opened this issue Jun 16, 2022 · 0 comments · Fixed by #271

Comments

@dancrumb
Copy link

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)

jwulf added a commit that referenced this issue Sep 19, 2022
@jwulf jwulf mentioned this issue Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant