Parcourir la source

Remove scope binding on x-data functions

Simone Todaro il y a 5 ans
Parent
commit
0374efa15d
3 fichiers modifiés avec 0 ajouts et 8 suppressions
  1. 0 0
      dist/alpine.js
  2. 0 0
      dist/alpine.js.map
  3. 0 8
      src/component.js

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/alpine.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/alpine.js.map


+ 0 - 8
src/component.js

@@ -15,14 +15,6 @@ export default class Component {
         // Construct a Proxy-based observable. This will be used to handle reactivity.
         this.$data = this.wrapDataInObservable(unobservedData)
 
-        // Walk through the raw data and set the "this" context of any functions
-        // to the observable, so data manipulations are reactive.
-        Object.keys(unobservedData).forEach(key => {
-            if (typeof unobservedData[key] === 'function') {
-                unobservedData[key] = unobservedData[key].bind(this.$data)
-            }
-        })
-
         // After making user-supplied data methods reactive, we can now add
         // our magic properties to the original data for access.
         unobservedData.$el = this.$el

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff