Skip to content

[JSLigo] #import a file without namespace will import everything (not only export values)

#import a file without namespace will import everything (not only export values)

File1.jsligo

#import "File2.jsligo" "Type"
  @entry
  const increment = (delta : int, store : Type.storage) : Type.ret =>
    [list([]), store + delta];

  @entry
  const decrement = (delta : int, store : Type.storage) : Type.ret =>
    [list([]), store - delta];

  @entry
  const reset = (_ : unit, _ : Type.storage) : Type.ret =>
    [list([]), 0];

File2.jsligo

  type storage = int;
  type ret = [list<operation>, storage];