prodo-dev / prodo

Prodo is a React framework to build apps faster.
https://docs.prodo.dev
MIT License
114 stars 5 forks source link

Local plugin nested values #158

Closed coffee-cup closed 5 years ago

coffee-cup commented 5 years ago

Previously the local plugin would only capture updates made to the top level of universe.local. So this would work (update universe and browser local storage)

local.a = "foo"

but this would not

local.a.b = "foo"

This PR makes the second example work. It also supports deleting of local storage items.

Instead of using a proxy to trap set calls to universe.local, I instead use the plugin onCompleteEvent hook to update local storage (if not in fixtures mode) with the new state of the universe and remove any values that were deleted. Some notable changes:

coffee-cup commented 5 years ago

closes #149