Code Monkey home page Code Monkey logo

dift's People

Contributors

ashaffer avatar troch 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

Watchers

 avatar  avatar  avatar  avatar

dift's Issues

Current position

I'm using dift in Deku now because it's way easier and way less broken :)

In the spirit of keeping things pure, I'm trying to avoid needing to store the DOM element on the vnode and just using indexes. It's a little hard to do with the current move effect because it only passes in the position where it needs to be moved to, and not where it needs to be moved from.

It'd be kind of nice to have something like:

function effect (type, prev, next, pos, prevPos) {
  // blah
}

That way I could just move the element in the DOM using it's current index rather than storing the vnode. You'd need to be keeping track of the current state of the list, but you know the code way better than me. If you can point me in the right direction, and this is something you'd like, I'm happy to open a PR.

Incorrect move pos detection

I have a case for a list of 10 elements, swapping list[1] and list[8] to each other

var tmp = list[1]
list[1] = list[8]
list[8] = tmp

Library incorrectly detects everything between 1 and 8 idx as moved and produces 8 MOVE effects, with prev = next for [2-7] elements.
Elements in between has the same indices and it should produce UPDATE for them.

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.