makerchip_examples icon indicating copy to clipboard operation
makerchip_examples copied to clipboard

Make better use of ES6

Open stevehoover opened this issue 5 years ago • 12 comments

The JS syntax I was using is a bit obsolete. Some things that could be cleaned up:

  • [ ] Remove all ;.
  • [ ] No need for the function keyword. E.g. initEach: function () { becomes initEach() {.
  • [ ] For object properties assigned to variables of the same name, a shorthand is permitted, so, e.g. return {objects: {rect: rect, shadow: shadow}}; becomes return {objects: {rect, shadow}}

stevehoover avatar Nov 21 '20 23:11 stevehoover

Sir, can I give it a try and if yes please brief me about this.

Alchemist1411 avatar Dec 23 '20 16:12 Alchemist1411

That would be great, Deepak. For each example, edit in Makerchip, make the 3 itemized changes above, and make sure the example still produces the same VIZ without errors in the console.log. Clear?

stevehoover avatar Dec 23 '20 16:12 stevehoover

You can fork and commit changes (through the github web interface, if you like), then submit a merge request w/ upstream master.

stevehoover avatar Dec 23 '20 16:12 stevehoover

Sir, can you tell me what is the file location. So, that I can do it with github web interface

Alchemist1411 avatar Dec 23 '20 17:12 Alchemist1411

You can do this for all .tlv files that have \viz_alpha code. (A few have been updated.)

stevehoover avatar Dec 23 '20 18:12 stevehoover

BTW, I was just working with life_sv_viz.tlv, so I cleaned that one up. You might find merge conflicts if you edit that one, so git checkout life_sv_viz.tlv if you did.

stevehoover avatar Dec 23 '20 23:12 stevehoover

Sir, I created a PR. Please check

Alchemist1411 avatar Dec 24 '20 16:12 Alchemist1411

Thanks!!! I will check after Christmas.

On Thu, Dec 24, 2020, 11:51 AM Deepak S [email protected] wrote:

Sir, I created a PR. Please check

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stevehoover/makerchip_examples/issues/2#issuecomment-750926142, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACWHLEDFPL63PXOXOEWVIM3SWNWQ7ANCNFSM4T6DCZ6Q .

stevehoover avatar Dec 24 '20 18:12 stevehoover

No Problem sir, BTW Merry Christmas

Alchemist1411 avatar Dec 25 '20 04:12 Alchemist1411

Sir, created a PR. Please check

Alchemist1411 avatar Dec 28 '20 02:12 Alchemist1411

Thanks!! Merged. There was one ";" that shouldn't have been removed, but I realized it was inside a comment anyway, and I restored it.

Steve Hoover https://www.linkedin.com/in/steve-hoover-a44b607/ 774-773-8333

http://www.redwoodeda.com/

On Sun, Dec 27, 2020 at 9:02 PM Deepak S [email protected] wrote:

Sir, created a PR. Please check

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stevehoover/makerchip_examples/issues/2#issuecomment-751547921, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACWHLEF4VJQU5GB33T4F273SW7RLDANCNFSM4T6DCZ6Q .

stevehoover avatar Dec 28 '20 15:12 stevehoover

Thanks sir and sorry for the mistake.

On Mon, 28 Dec 2020, 9:30 p.m. Steve Hoover, [email protected] wrote:

Thanks!! Merged. There was one ";" that shouldn't have been removed, but I realized it was inside a comment anyway, and I restored it.

Steve Hoover https://www.linkedin.com/in/steve-hoover-a44b607/ 774-773-8333

http://www.redwoodeda.com/

On Sun, Dec 27, 2020 at 9:02 PM Deepak S [email protected] wrote:

Sir, created a PR. Please check

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/stevehoover/makerchip_examples/issues/2#issuecomment-751547921 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACWHLEF4VJQU5GB33T4F273SW7RLDANCNFSM4T6DCZ6Q

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stevehoover/makerchip_examples/issues/2#issuecomment-751763239, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARSGU4PWXYJI33XSISSMJKDSXCTQHANCNFSM4T6DCZ6Q .

Alchemist1411 avatar Dec 29 '20 01:12 Alchemist1411