Skip to content

how can i make extendObservable work when i use pojo object? #10

@eastedFE

Description

@eastedFE

Hi i test code like below,but it got undefined,i use latest umd mobx code,thanks for your help,
var Person = function (firstName, lastName, age) {
this.id = .uniqueId('person');
mobx.extendObservable(this, {
firstName: firstName,
lastName: lastName,
age: age,

	fullName:function () {//error code 
		console.count('fullName');
		return this.firstName + ' ' + this.lastName;
	}
});

};

var person = new Person('Matt', 'Ruby', 0);

mobx.autorun(function () {
console.log(person.fullname);//get undefined
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions