crcn / immutable-ot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adapter for different immutable objects

crcn opened this issue · comments

Such as immutableJS. API might look something like:

import {List, Map} from "immutable";

const adapter = {
  isList(object => object instanceOf List),
  isMap(object => object instanceOf Map),
  iterateList((list, each => list.forEach(each)),
  iterateMap((map, each => map.forEach(each)),
};

const mutations = diff(oldObject, newObject,  { adapter });