GithubHelp home page GithubHelp logo

Comments (10)

jareware avatar jareware commented on May 11, 2024 3

@granmoe FWIW, I'm using https://github.com/intelie/immutable-js-diff and it works really nicely.

from immutable-js.

leebyron avatar leebyron commented on May 11, 2024

I'm not sure I understand the question, but certainly immutable-js supports applying diffs. I think mergeDeep is probably what you're looking for.

from immutable-js.

jsilvestre avatar jsilvestre commented on May 11, 2024

I think the question is more "can I get and store the diff itself so I can store it locally and sync it with a server". I guess it aims at making an web app available offline while handling synchronization easily.

I.E :

vector1 = vector with value a, b
vector2 = vector1.push c
{json formatted} = Immutable.diff vector1, vector2

Where diff returns the smallest set of operations to perform to go from vector1 to vector2 in a machine-readable way.

from immutable-js.

leebyron avatar leebyron commented on May 11, 2024

Ah, I understand. I think that is out of scope for this project. Such a process should be equally applicable to non-immutable objects. You might want to look into JSONPatch to get started with this.

from immutable-js.

slorber avatar slorber commented on May 11, 2024

@steida hi

Have you been successful with json patch?
I'm looking at how json state transitions can be recorded.
This is related to a video I just published: https://www.youtube.com/watch?v=zxN8FYYBcrI

from immutable-js.

pedroteixeira avatar pedroteixeira commented on May 11, 2024

I've been using: https://github.com/intelie/immutable-js-diff e https://github.com/intelie/immutable-js-patch

from immutable-js.

slorber avatar slorber commented on May 11, 2024

thanks @pedroteixeira I didn't know about these projects

from immutable-js.

Lendar avatar Lendar commented on May 11, 2024

Another lib for immutable.js diffs: https://github.com/elierotenberg/remutable — it's more polished, but currently supports only Map.

from immutable-js.

vpryim avatar vpryim commented on May 11, 2024

@slorber, you can try transit-js. I used it to serialize the history of application state for next transfering over the wire. You can add a cache on top of this library to serialize immutable data structures efficiently. David Nolan wrote a post about this feature of transit - Transit-js Caching.

from immutable-js.

granmoe avatar granmoe commented on May 11, 2024

It's been over a year. Any new resources for this? I have a similar need.

from immutable-js.

Related Issues (20)

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.