Skip to content

Modifiers Aren't Pulled Into Parent's Modifiers #57

@G0ldenSp00n-zz

Description

@G0ldenSp00n-zz

Describe the bug
When creating modifiers with Radon, each modifier should be pulled out and placed into a the modifiers object of the parent, in the same structure as the data in the parent object. As the data in the parent should be deconstructed and back as it's primitive form.

To Reproduce
Steps to reproduce the behavior:

  1. Create A ConstructorNode called Root, and Initialize the Modifiers with Functions
  2. Create a variable generatedTree and set it to CombineNodes with the ConstructorNode
  3. View generatedTree.Root.modifiers and notice that it isn't filled with the created modifiers.

Expected behavior
The data returned to the developer should be deconstructed from SiloNodes, meaning that it should have a .val that has to be called, along with the modifier should be pulled out and kept in the ContainerNode, as the developer is expecting to work with a state that mirror's the way they setup the state tree.

Test Snippet

    test('Collections Should Be Given KeySubscribe', () => {
        let rootNode = new ConstructorNode('Root');

        rootNode.initializeState({
            testArr: [1, 2, 3],
            testObj: {key1: 1, key2: 2, key3: 3}
        });

        let generatedTree = combineNodes(rootNode);

        console.warn('Collections Should Be Given KeySubscribe: Removed Due to Bug Bug #57 - https://github.com/radonjs/Radon/issues/57');
        //Removed Due to Bug Bug #57 - https://github.com/radonjs/Radon/issues/57
        // expect(generatedTree.Root.modifiers.testArr.keySubscribe).toBeTruthy();
        // expect(generatedTree.Root.modifiers.testObj.keySubscribe).toBeTruthy();
    });

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions