System.js 227 B

12345678910111213141516171819
  1. import React from 'react';
  2. export default class BaseSystem{
  3. constructor(){
  4. this.__update = null;
  5. }
  6. onUpdate(fn){
  7. this.__update = fn;
  8. return this;
  9. }
  10. forceUpdate(){
  11. return this.__update && this.__update();
  12. }
  13. }