Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added async example.

  • Loading branch information...
commit d47466e452c336d1110100892dba47f7627b39b5 1 parent 01ae9b8
Mike Cantelon authored

Showing 1 changed file with 18 additions and 0 deletions. Show diff stats Hide diff stats

  1. 18  examples/async.js
18  examples/async.js
... ...
@@ -0,0 +1,18 @@
  1
+var mingy = require('../lib/mingy')
  2
+  , Parser = mingy.Parser
  3
+  , Command = mingy.Command
  4
+
  5
+var parser = new Parser()
  6
+
  7
+parser.addCommand('add')
  8
+.set('syntax', ['test'])
  9
+.set('logic', function(args, env, system) {
  10
+
  11
+  setTimeout(function() {
  12
+    system.callback('Time has passed.');
  13
+  }, 1000);
  14
+})
  15
+
  16
+parser.parse('test', function(message) {
  17
+  console.log(message);
  18
+});

0 notes on commit d47466e

Please sign in to comment.
Something went wrong with that request. Please try again.