Skip to content

ability to call set after value() or generate snapshot at any time #26

@ilovett

Description

@ilovett

It would be helpful to either be able to get a copy of the next immutable state, or at least fetch what the next values will be... This would be helpful for calculating aggregations on new data in reducers...

case: 'ADD_USER':
  next = immutable(state);
  next.set(['path' ,'to', 'users', 'byId', user.id], user);
  next.set(['path', 'to', 'users', 'aggregations', 'totalUsers', Object.keys(next.get(['path', 'to', 'users', 'byId'])).length);
  return next.value();

Getting would be preferable or at least being able to call next.value() then a set then another next.value() if I need to, but I get an error that I can't set after calling value:

Error: Cannot call set after `value`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions