Inception model

Models

const Inception_Parent = Fractale.create("Inception_Parent", {
    value: String
});

const Inception_Child = Fractale.create("Inception_Child", {
    parent: Inception_Parent,
    value: String
});

Run

const { Inception_Child } = module.exports.get();
const child = new Inception_Child({
    parent: { value: 'foo' },
    value: 'bar',
});

_.test(child.parent.value, 'foo', 'Error on inception setter with dot');

const parent = child.parent;
const value = 'hello world';
parent.value = value;
_.test(child.parent.value, value, 'Error on inception setter with dot');

child.parent.value = 'foo';
_.test(child.parent.value, 'foo', 'Error on deep setter with dot');

resolve(child);

Results

{
    "uuid": "d2dd4dd1-f369-4ed8-821e-5040deed075b",
    "parent": {
        "uuid": "33ba3961-cc86-4dbc-9945-b0691bd36d93",
        "value": "foo"
    },
    "value": "bar"
}

Last updated