Update docs to include examples of sequence creation and package binding (#167)
* docs(readme): add example for creation of a sequence
* docs(readme): provide example for binding a package
diff --git a/README.md b/README.md
index 1dc69aa..57916cb 100644
--- a/README.md
+++ b/README.md
@@ -217,6 +217,20 @@
})
```
+### create sequence from another action
+
+```javascript
+const actionName = '/mynamespace/reverseWords'
+const name = 'reverse'
+
+ow.actions.create({ name, action: {
+ exec: {
+ kind: 'sequence',
+ components: [ actionName ]
+ }
+}})
+```
+
### retrieve action resource
```javascript
@@ -264,6 +278,24 @@
})
```
+### bind a package from another namespace
+
+```javascript
+const name = 'myBoundPackage'
+const package = {
+ binding: {
+ namespace: "othernamespace", // namespace to bind from
+ name: "otherpackage" // package to bind from
+ }
+}
+
+ow.packages.update({name, package}).then(package => {
+ console.log('bound package:', package.name)
+}).catch(err => {
+ console.error('failed to bind package', err)
+})
+```
+
### create trigger feed from alarm package
```javascript