Comments (2)
The windowsUpdated function in your code seems redundant as it's merely calling another function, updateNumberOfCubes(), without performing any additional logic. As it stands, removing windowsUpdated and directly calling updateNumberOfCubes() wherever windowsUpdated() is called would likely simplify the code without losing any functionality.
Sometimes, developers create intermediate functions like windowsUpdated for potential future expansion or to maintain a consistent structure across the codebase. However, if it doesn't serve any clear purpose beyond calling another function and there are no plans for extending its functionality in the future, removing it could indeed streamline the code. Always remember to ensure that removing such functions won't impact other parts of the codebase before doing so.
function setupWindowManager ()
{
windowManager = new WindowManager();
windowManager.setWinShapeChangeCallback(updateWindowShape);
windowManager.setWinChangeCallback(windowsUpdated);
// here you can add your custom metadata to each windows instance
let metaData = {foo: "bar"};
// this will init the windowmanager and add this window to the centralised pool of windows
windowManager.init(metaData);
// call update windows initially (it will later be called by the win change callback)
windowsUpdated();
}
function windowsUpdated ()
{
updateNumberOfCubes();
}
from multiplewindow3dscene.
The windowsUpdated function in your code seems redundant as it's merely calling another function, updateNumberOfCubes(), without performing any additional logic. As it stands, removing windowsUpdated and directly calling updateNumberOfCubes() wherever windowsUpdated() is called would likely simplify the code without losing any functionality.
Sometimes, developers create intermediate functions like windowsUpdated for potential future expansion or to maintain a consistent structure across the codebase. However, if it doesn't serve any clear purpose beyond calling another function and there are no plans for extending its functionality in the future, removing it could indeed streamline the code. Always remember to ensure that removing such functions won't impact other parts of the codebase before doing so.
function setupWindowManager ()
{
windowManager = new WindowManager();
windowManager.setWinShapeChangeCallback(updateWindowShape);
windowManager.setWinChangeCallback(windowsUpdated);
// here you can add your custom metadata to each windows instance
let metaData = {foo: "bar"};
// this will init the windowmanager and add this window to the centralised pool of windows
windowManager.init(metaData);
// call update windows initially (it will later be called by the win change callback)
windowsUpdated();
}
function windowsUpdated ()
{
updateNumberOfCubes();
}
from multiplewindow3dscene.
Related Issues (20)
- multipleWindow3dScene
- How to run this HOT 12
- Could you share the full demonstration code? HOT 15
- 7 HOT 1
- Cors Policy HOT 3
- Create a ReadMe file HOT 1
- Too cool, this is the best creativity I've seen this year, I never thought localStorage could be used like this.
- Submit the final code to experiments with google
- Add this to the description for making it easier to find for people who are looking to just see whats up. HOT 2
- Can you make this online? HOT 2
- didnt work HOT 4
- . HOT 1
- White Screen HOT 7
- Cube with red verges HOT 1
- When the window is hidden, the cube still stays in its previous position.
- Development of this amazing project
- Addressing the video --'Viral Video of Two Spherical Earths Syphoning Particles' -- Answer is HERE: HOT 4
- Getting Started - For all those who are confused.
- trial for open source stufff
- Why this window keeps opening up on my browser?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multiplewindow3dscene.