kreonjr / omniaural

A React Global State Manager with no boilerplate
3 stars 1 forks source link

Add Getter/Setter creation capability #16

Open kreonjr opened 2 years ago

kreonjr commented 2 years ago

OmniAural initial state should automatically create actions for set and get for any level of nested property when the property ends with an underscore.

initialState = {
   account: {
     name_: "",
     phone: 0
   }
}

This would create 2 actions:

  1. OmniAural.setAccountName()
  2. OmniAural.getAccountName()

Underscore gets removed on OmniAural property creation.