daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { MyDomain } from './myapp'
  2.  
  3. // Once you have constructed a domain you can define
  4. // the structure types present in your application
  5. const Person = MyDomain.createType('Person', {
  6.   name: 'string',
  7.   wallet: 'address'
  8. })
  9.  
  10. // Types will maintain a reference to the constructing domain
  11. // So you can reference other previously created types
  12. const Mail = MyDomain.createType('Mail', {
  13.   to: 'Person',
  14.   from: 'Person',
  15.   body: 'string'
  16. })
  17.  
  18. /**
  19.  * Note regarding key order: the ECMAScript2015 specification preserves
  20.  * insertion order for object keys, provided that the keys are strings
  21.  * and the values are not functions.  This was not a part of previous
  22.  * ECMAScript specifications, but has become de-facto javascript standard.
  23.  * Certain older browsers may not have a defined order for object properties,
  24.  * so you may also use an array to define the order of properties explicitly
  25.  */
  26. const Person = MyDomain.createType('Person', [
  27.   {name: 'name', type: 'string'},
  28.   {name: 'wallet', type: 'address'},
  29. ])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top