GithubHelp home page GithubHelp logo

bacon.model's People

Contributors

apaleslimghost avatar bryant1410 avatar dandelany avatar lautis avatar matchdav avatar raimohanska avatar sveinatle avatar wolfflow 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bacon.model's Issues

Memory leak binding many models

I get a huge memory leak if it try to bind many models at same time.

var a = new Bacon.Model(),
    i = 0,
    ITEMS_AMOUNT = 5000;

while (i++ < ITEMS_AMOUNT) {
    var data = new Bacon.Model();
    a.bind(data);
}

a.set('hello');

Here is the screenshot of the heap profiler in chrome

screen shot 2014-10-28 at 23 36 33

I've tried to fix the issue but it seems to come directly from Baconjs

Status on this project?

I've noticed that the last commit was almost over 3 months ago, so I'm curious about your outlook on this project. Is there a reason that it hasn't been updated? Are you looking for help to maintain it?

Thanks!

allow custom equality relation

I'd like to be able to set my own equals(a, b) function on a Model so that it can skip duplicates properly for simple value-like objects (e.g., time, coordinates).

This is probably simple enough to implement. I'd create a pull request, but I'm not experienced with Coffeescript, and I'm not sure what kind of API you would prefer.

Initial value inconsistency with flatMap and slidingWindow stream

This one has been bothering me for a few days now and I am not able to figure it out.

I have the following trivial Bacon/BaconModel code:

var t = new Bacon.Model(5);
t.slidingWindow(2,1).changes().onValue(value => {
  if (value.length == 1)
    console.log("t : "+value[0]);
  else
    console.log("t : "+value[1]+","+value[0]);
});
t.set(8);
t.set(2);
t.set(3);

What this seems to produce is the following stream:

t : 8,5
t : 2,8
t : 3,2

There is no initial value in this stream.

But as soon as I introduce a trivial flatMap into the mix, I start receiving the initial value which is NOT what I want. Please disregard what the sample flatMap does - it is simple yet valid I think for illustration purposes..

var t = new Bacon.Model(5);
t.flatMap(value => {return value}).slidingWindow(2,1).changes().onValue(value => {
   if (value.length == 1)
       console.log("t : "+value[0]);
   else
       console.log("t : "+value[1]+","+value[0]);
});
t.set(8);
t.set(2);
t.set(3);

The output stream becomes:

t : 5
t : 8,5
t : 2,8
t : 3,2

Please, could someone explain why is addition of flatMap causing the initial value t : 5 to be generated by this chain? Is this as designed or a bug ? If as designed, can you explain why it is generating the initial value output?

fiddle

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.