Skip to content

Refine Bucket's typing #31

@cyber-barrista

Description

@cyber-barrista

Expected Behavior / Situation

Bucket<T> constructors should accept a default T. The ones without a default value should return Bucket<Partial<T>>

Actual Behavior / Situation

Existing bucket constructors don't accept a default value but return Bucket<T>

Modification Proposal

The type system is a bit too optimistic as T[K] might not hold any value yet (just initialised) or already (after calling remove). Making the output partial would bring it in line with reality.

If a meaningful default value available and provided for T it would allow to overcome the problem outlined above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions