webarkit / ARnft

A small javascript library for WebAR with NFT
GNU Lesser General Public License v3.0
219 stars 54 forks source link

added autoUpdate option and initWithConfig function. #231

Closed stevensyzygy closed 3 years ago

stevensyzygy commented 3 years ago

Renamed interface Entity to IEntity Added interface IInitConfig, INameInitConfig, IEntityInitConfig. Added new init function using config object. Added autoUpdate field and update function, allows to maintain update yourself. Added arNFT_autoupdate_example.html converted some Promise Chains to async/await.

kalwalt commented 3 years ago

Thank you @stevensyzygy ! Have you seen that in this PR #223 i also introduced an update function? https://github.com/webarkit/ARnft/blob/2c13502ec2bf792683c71bb90b09b48ecc2db12c/src/ARnft.ts#L231-L243 That is used only internally by the initialize function. To avoid conflicts i will rename to internalUpdate. I also saw other changes in the code that i will review. In detail i appreciate the work improving the Promises. I haven't merged yet but i will merge soon with the changes in my private update function.

albjeremias commented 3 years ago

I got a bit confused with the autoupdate, for me its a bit hard to review all of it, would be cool if it could be split in different small PRs :)

kalwalt commented 3 years ago

@stevensyzygy see this discussion https://github.com/webarkit/ARnft/discussions/236

kalwalt commented 3 years ago

The conflicting files is caused because i forgot to rebuild the libs before merging, Sorry for this!

kalwalt commented 3 years ago

@stevensyzygy great!

stevensyzygy commented 3 years ago

found a mistake in ARnft.ts:161. _arnft.autoUpdate = params.autoUpdate ?? true; // instead of _arnft.autoUpdate = params.autoUpdate;