-
-
Save anonymous/bcd612cb9398ce67ae80ee9c55e5a594 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function w_render() | |
local self = {} | |
local onrender_cb | |
function self.onrender(cb) | |
onrender_cb = cb | |
end | |
function self.render() | |
onrender_cb() | |
end | |
return self | |
end | |
local w = w_render('value') | |
w:onrender(function() | |
print('onrender') | |
end) | |
w:render() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment