Skip to content

Allow for deep get/set based on . separated keys #31

@nab911

Description

@nab911

Often times I want to update a property a few levels down an object. Instead of having to pull the object from the store, update the key, and set it back to the store, we could allow for parsing of the passed in key to deep get/set a property.

Example:

store.set('map', { 
  level1: { 
    level2: {
      thing: 1
    }
  }
});

const thing = store.get('map.level1.level2.thing'); // thing === 1 

Same idea for a deep set. Unless there is some philosophical reason for keeping store access single level, this could be a nice enhancement.

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