Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

add [] and []= operators to state and mutate #4

Open
catmando opened this issue May 15, 2017 · 0 comments
Open

add [] and []= operators to state and mutate #4

catmando opened this issue May 15, 2017 · 0 comments

Comments

@catmando
Copy link
Contributor

so you can do things like
state[my_var]
and
mutate[my_var] = 12

etc...

This is a working monkey patch:

class HyperStore::StateWrapper < HyperStore::BaseStoreClass
  def [](x)
    __send__(x)
  end
end

class HyperStore::MutatorWrapper < HyperStore::BaseStoreClass
  def [](x)
    __send__(x)
  end
  def []=(x, y)
    __send__(x, y)
  end
end

Need to add a test spec is all...

@catmando catmando added this to the Release 0.15 milestone Nov 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant