• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Difference between revisions of "Module:View"

From Kancolle Wiki
Jump to navigation Jump to search
m
Line 7: Line 7:
 
local _ = require('Module:Core')
 
local _ = require('Module:Core')
  
return function(render)
+
return function(render, test)
 
   return {
 
   return {
 
     render = function(frame)
 
     render = function(frame)
 
       return render(frame and _.getTemplateArgs(frame) or {}, frame)
 
       return render(frame and _.getTemplateArgs(frame) or {}, frame)
     end
+
     end,
 +
    test = function(frame)
 +
      return render(test, frame)
 +
    end,
 
   }
 
   }
 
end
 
end

Revision as of 13:47, 18 July 2019

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')

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