WIP: Moving python snabbdom interface and adding some modules
This commit is contained in:
19
src/lib/snabbdom.py
Normal file
19
src/lib/snabbdom.py
Normal file
@@ -0,0 +1,19 @@
|
||||
__pragma__ ('noanno')
|
||||
__pragma__ ('js', """
|
||||
var snabbdom = require('snabbdom');
|
||||
|
||||
var s_patch = snabbdom.init([ // Init patch function with chosen modules
|
||||
require('snabbdom/modules/class').default, // makes it easy to toggle classes
|
||||
require('snabbdom/modules/props').default, // for setting properties on DOM elements
|
||||
require('snabbdom/modules/attributes').default, // for setting attributes on Html tags
|
||||
require('snabbdom/modules/style').default, // handles styling on elements with support for animations
|
||||
require('snabbdom/modules/dataset').default, // adding dataset attributes
|
||||
require('snabbdom/modules/eventlisteners').default, // attaches event listeners
|
||||
]);
|
||||
var s_h = require('snabbdom/h').default; // helper function for creating vnodes
|
||||
""", None)
|
||||
|
||||
# export the symbols
|
||||
|
||||
h = s_h
|
||||
patch = s_patch
|
||||
Reference in New Issue
Block a user