Git Product home page Git Product logo

react's People

Contributors

cowboyd avatar dependabot[bot] avatar greenkeeper[bot] avatar kmckee avatar taras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lyleg mwq27 kmckee

react's Issues

.increment() not working called before a .push()

I noticed this today while building a sample app with microstates. I have a TodoState type that looks like:

class TodoState {
  todos = [Todo];
  count = Number;

I think have a method that adds a todo to the list. In my methdo I am trying to

  • add the todo to the list of todos
  • increment the count
const inc = model => {
    model.count.increment();
    model.posts.push({ id: Date.now() });
  };

In the above code, the increment never happens, but the push WILL happen.

Here's a code sandbox of what I'm trying to do. If you flip lines 17 and 18, the increment will work.
https://codesandbox.io/s/13yv7ojlkl

initialize function throwing Max call stack error with Array type

I have a TodoState here, trying to initialize the todos prop like below.

export class TodoState {
  todos = [Todo];
  count = Number;

  initialize({ todos, count } = {}) {
    let initialized = this;
    initialized.todos.set([
      {
        id: Date.now(),
        text: "Initial Todo",
        complete: false
      }
    ]);
    initialized.count.set(1);
    return initialized;
  }
}
...
<State type={TodoState} ....></State>

I've even tried initialized.todos.push(...), but same Maximum call stack error. Am I doing something wrong here?

Tests should run against the dist files

Before #1, the tests in this package ran against dist files. This is the same setup that we have in microstates repository. It allows us to catch any module export changes that could cause a problem in the package. For the sake of consistency, let's restore this functionality.

To make this work you have to run build before each test module by setting the globalSetup and moduleNameMapper.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.