Comments (10)
@granmoe FWIW, I'm using https://github.com/intelie/immutable-js-diff and it works really nicely.
from immutable-js.
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.
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.
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.
@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.
I've been using: https://github.com/intelie/immutable-js-diff e https://github.com/intelie/immutable-js-patch
from immutable-js.
thanks @pedroteixeira I didn't know about these projects
from immutable-js.
Another lib for immutable.js diffs: https://github.com/elierotenberg/remutable — it's more polished, but currently supports only Map.
from immutable-js.
@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.
It's been over a year. Any new resources for this? I have a similar need.
from immutable-js.
Related Issues (20)
- ReferenceError: Immutable is not defined HOT 9
- Highlight inputs where `Set` can't maintain uniqueness HOT 4
- Flow type definition outdated, not working with last year changes HOT 1
- Urgent: Package Installation Reveals Multiple Vulnerabilities HOT 1
- Type predicate missing on isOrderedSet function type declaration
- support deno HOT 2
- immutable default import in 5.x HOT 1
- version 4.3.3 breaks TS/Angular/webpack HOT 2
- Typescript: Implement `MapOf::merge ` HOT 1
- Extract sort function from Collection types HOT 6
- Enhancement: Custom equals HOT 8
- Strange edge case with Map.update(...) HOT 3
- Moving off deprecated dependencies HOT 10
- filter followed by slice with negative begin not working HOT 4
- where is the doc of the v5? HOT 1
- using typescript instance class HOT 1
- List.has() should do the same as List.includes() HOT 3
- OrderedSet equality and hashCode bug HOT 1
- Singleton `emptyList` is problematic HOT 4
- Typescript return type of sort/sortBy on non-Ordered Collections isn't accurate HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immutable-js.