From b99de1d4e79e6c4a548d9dddca730eaeeb63a1c9 Mon Sep 17 00:00:00 2001 From: s-ol Date: Wed, 31 Oct 2018 19:52:16 +1100 Subject: almost there tbh --- lib/mmmfs/init.moon | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lib/mmmfs/init.moon') diff --git a/lib/mmmfs/init.moon b/lib/mmmfs/init.moon index bb26505..172f0ef 100644 --- a/lib/mmmfs/init.moon +++ b/lib/mmmfs/init.moon @@ -1,7 +1,35 @@ require = relative ... import Key, Fileder from require '.fileder' +import Browser from require '.browser' +import tohtml from require 'lib.component' + +define_fileders = (...) -> + source_module = ... + + (...) -> + with fileder = Fileder ... + .source_module = source_module + +rehydrate = (path) -> + import Browser from require 'lib.mmmfs.browser' + root = require 'root' + root\mount! + + export BROWSER + BROWSER = Browser root, path, true + +render = (root, path) -> + export BROWSER + BROWSER = Browser root, path + + str = tohtml BROWSER + str ..= on_client rehydrate, path + str { :Key :Fileder + :render + :define_fileders + :module_roots } -- cgit v1.2.3