onData method

Window onData(
  1. OnDataHanlder handler
)

on data to receive data from other shared maybe same like event handler but one window in engine can only have one data handler to make sure data not be comsumed multiple times.

Implementation

Window onData(OnDataHanlder handler) {
  assert(_onDataHandler == null, "onData can only called once");
  _onDataHandler = handler;
  return this;
}