diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-10-19 04:58:14 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-10-19 04:58:14 +0000 |
| commit | 28569b422ae3206209384b09dc5d60155e9f670e (patch) | |
| tree | a7524c6d7b8ff7e41f020274e4e51a56e06ce7b7 /lib/init.client.moon | |
| parent | switch to self-rendering lua code (diff) | |
| download | mmm-28569b422ae3206209384b09dc5d60155e9f670e.tar.gz mmm-28569b422ae3206209384b09dc5d60155e9f670e.zip | |
stable serverside rendering
Diffstat (limited to 'lib/init.client.moon')
| -rw-r--r-- | lib/init.client.moon | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/init.client.moon b/lib/init.client.moon new file mode 100644 index 0000000..509f225 --- /dev/null +++ b/lib/init.client.moon @@ -0,0 +1,23 @@ +export MODE, print, warn, relative, append, on_client +export window, document + +window = js.global +document = window.document + +MODE = 'CLIENT' +print = window.console\log +warn = window.console\warn + +-- package.path = './?.shared.lua;./?.client.lua;' .. package.path +package.path = './?.shared.moon.lua;./?.client.moon.lua;./?.moon.lua;./?/init.moon.lua;./?.lua;./?/init.lua' + +-- relative imports +relative = (...) -> + path = ... + + (name) -> + name = path .. name if '.' == name\sub 1, 1 + require name + +append = document.body\appendChild +on_client = (f, ...) -> f ... |
