Test example for #55

This commit is contained in:
2019-06-04 15:38:17 -06:00
parent 12add09659
commit 3da00b36bd
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
```
story.insertionHooks["hank.Story"] = function(value) {
return "Whoa there! You can't insert a whole story into itself!";
};
story.insertionHooks["String"] = function(value) {
if (value.substr(0, 7) == "prefix:") {
return "PREFIXED VALUE: " + value.substr(7);
} else {
return value;
}
};
```
{"prefix:Testing insertion hooks"}
{story}
{"Did it work?"}

View File

@@ -0,0 +1,3 @@
PREFIXED VALUE: Testing insertion hooks
Whoa there! You can't insert a whole story into itself!
Did it work?