Skip to content

in operator regression for actions #1639

@getkey

Description

@getkey

Bug report

  • I've checked documentation and searched for existing issues
  • I've made sure my project is based on the latest MST version not applicable
  • Fork this code sandbox or another minimal reproduction.

Sandbox link or minimal reproduction code

https://stackblitz.com/edit/in-regression-mobx-state-tree?file=index.html

import { types } from "mobx-state-tree";

const User = types
  .model({
    name: ""
  })
  .actions(self => ({
    setName(name) {
      self.name = name;
    }
  }));

const john = User.create();
console.log("This should be true:", "setName" in john);

Describe the expected behavior

The in operator should detect actions. I've observed that the regression appeared somewhere between version 4.0.2 and 4.0.3.

Describe the observed behavior

The in operator doesn't detect actions on instances of the model.

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