8000 Record inheritance in Typescript? · Issue #166 · immutable-js/immutable-js · GitHub
[go: up one dir, main page]

Skip to content
Record inheritance in Typescript? #166
Closed
@abergs

Description

@abergs

I were struggling with converting a model of ours to a Immutable.Map and found Record, which is perfect because we need to implement some functions.

But It doesn't seem to be possible to use the example syntax i Typescript?

import Immutable = require("immutable");

class ABRecord extends Immutable.Record({ a: 1, b: 2 }) {
    getAB() {
        return this.a + this.b;
    }
}

var myRecord = new ABRecord(b:3);
myRecord.getAB();// 4

Doesn't compile at all, "The property 'Record' does not exist on value of type 'Immutable'."
Any tips?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0