omniscientjs / immstruct

Immutable data structures with history for top-to-bottom properties in component based libraries like React. Based on Immutable.js
374 stars 21 forks source link

Create reference cursor from a cursor. #33

Closed dashed closed 9 years ago

dashed commented 9 years ago

This:

let cursor = structure.cursor(keyPath);
let everlasting = structure.reference(cursor);

This is needed for this: https://github.com/omniscientjs/immstruct/issues/19

mikaelbr commented 9 years ago

This might require us to use internals of Immutable.js.

dashed commented 9 years ago

Yes it depends on internals: https://github.com/facebook/immutable-js/blob/7d69f95c5227c88c6a1be8271abc6686aeda94bf/contrib/cursor/index.js#L44

There's no official exposed API for cursor's keypath.