Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import(/* webpackChunkName: "momentjs" */ "moment")
  2. .then(function (moment) {
  3. // lazyModule has all of the proper types, autocomplete works,
  4. // type checking works, code references work \o/
  5. var time = moment().format();
  6. console.log("TypeScript >= 2.4.0 Dynamic Import Expression:");
  7. console.log(time);
  8. _this.setState({ time: time });
  9. })
  10. .catch(function (err) {
  11. console.log("Failed to load moment", err);
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement