Module:View

Revision as of 17:18, 4 June 2020 by がか (talk | contribs) (7 revisions imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:View/doc

---
-- Wrap (args, frame?) -> wikitext function into a frame -> wikitext function.
--
-- [[Category:Todo]]: actually should provide a react-like view library.
--

local _ = require('Module:Core')

local DummyFrame = {}

function DummyFrame:preprocess(x)
  return x
end

return function(render, test)
  return {
    render = function(frame)
      return render(frame and _.getTemplateArgs(frame) or {}, frame)
    end,
    test = function()
      return render(test, DummyFrame)
    end,
  }
end