github Tencent/omi v4.0.16
Simple checking for updating of observe element

latest releases: v7.6.6, v7.6.1, v7.5.6...
5 years ago

https://github.com/Tencent/omi/blob/master/packages/omi/src/observe.js#L14-L20

It should be noted that if observe is used, do not set the value of data in some of the following functions: some complex objects such as obj or arr:

  • render
  • beforeRender
  • beforeUpdate
  • afterUpdate

Because data settings will simply compare the value before and after, complex objects will not be deep contrast, the contrast value will trigger different update, update will trigger the above function, infinite recursion.

But you set the property of data as a simple value type(string, number, bool ...)in those functions.

Don't miss a new omi release

NewReleases is sending notifications on new releases.