MithrilJS / mithril-codemods

jscodeshift-powered mithril@0.2.x to mithril@1.x transformations
MIT License
19 stars 4 forks source link

controller to oninint should rename first arg to vnode #10

Closed tivac closed 8 years ago

tivac commented 8 years ago

Because this is odd-looking.

- controller : function(options) {
+ oninit: function(options) {
      var ctrl = this,
-         val  = get(options.field, "attrs.value");
+         val  = get(options.attrs.field, "attrs.value");

-     ctrl.id = id(options);
+     ctrl.id = id(options.attrs);
tivac commented 8 years ago

Working on this in https://github.com/tivac/mithril-codemods/tree/controller-first-arg - very broken atm.