From e6feb9efd3579d2881a311b4458257835b4d80f3 Mon Sep 17 00:00:00 2001 From: Vitor Cortez Date: Thu, 24 Nov 2016 16:21:10 -0300 Subject: [PATCH] Update Mache's example on README.md Found a typo where `mykey` was showed instead of `mytest`. Also added an example line to clarify what mache does. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 031721e..ba00c94 100644 --- a/README.md +++ b/README.md @@ -125,9 +125,11 @@ mache.set("mykey", { test: "anothertest" }); +mache.get("mykey"); // returns { test: "anothertest" } + mache.revert("mykey"); -mache.get("mykey"); // returns { test: "mykey" } +mache.get("mykey"); // returns { test: "mytest" } ``` Mache transactions work similar to SQL transactions; when you want to start simply call ```.begin()``` on your mache instance, then get and set whatever you want. Once you're finished either call ```.rollback()``` to end the transaction and eliminate all changes done during that time or ```.commit()``` to commit all of the changes made. You can even create a mache instance with some configuration options to change the level of revisions to store outside of transactions along with emitting all changes through messages so as data changes your components can react to said changes.