ঘোষণা :
15 এপ্রিল, 2025 এর আগে আর্থ ইঞ্জিন ব্যবহার করার জন্য নিবন্ধিত সমস্ত অবাণিজ্যিক প্রকল্পগুলিকে অবশ্যই আর্থ ইঞ্জিন অ্যাক্সেস বজায় রাখার জন্য
অ-বাণিজ্যিক যোগ্যতা যাচাই করতে হবে।
ui.util.throttle
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
প্রতি ব্যবধানে সর্বাধিক দুইবার কল করার জন্য একটি ফাংশনকে মোড়ানো হয়। বিলম্ব শেষ হওয়ার আগে যদি র্যাপার ফাংশনটি একাধিকবার কল করা হয় তবে শুধুমাত্র প্রথম এবং শেষ কলগুলি করা হবে৷
উদাহরণ ব্যবহার: একটি ui.Slider-এ একটি স্লাইড ইভেন্টে কলব্যাকের জন্য। কলব্যাক অবিলম্বে চালানো হবে, যাতে স্লাইড অ্যাকশন প্রতিক্রিয়াশীল হয়৷ ব্যবহারকারীর স্লাইডারের সাথে ইন্টারঅ্যাক্ট করা শেষ করার পরেও কলব্যাক চালানোর নিশ্চয়তা দেওয়া হয়, নিশ্চিত করে যে চূড়ান্ত কলব্যাক আহ্বানের স্লাইডারের চূড়ান্ত মানটিতে অ্যাক্সেস রয়েছে।
মোড়ানো ফাংশন প্রদান করে।
ব্যবহার | রিটার্নস | ui.util.throttle(func, delay, scope ) | ফাংশন |
যুক্তি | টাইপ | বিস্তারিত | func | ফাংশন | কল করার ফাংশন। |
delay | সংখ্যা | থ্রোটলের জন্য বিলম্ব, মিলিসেকেন্ডে। প্রাথমিক আহ্বানের পরে বিলম্ব শেষ না হওয়া পর্যন্ত ফাংশনটি শুধুমাত্র একবার কল করা যেতে পারে। |
scope | বস্তু, ঐচ্ছিক | যে অবজেক্টের সুযোগে ফাংশন কল করতে হবে। |
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eLimits a function's execution to at most twice per specified interval, ensuring responsiveness and capturing the final state.\u003c/p\u003e\n"],["\u003cp\u003eUseful for scenarios like UI slider events where immediate feedback and final value processing are crucial.\u003c/p\u003e\n"],["\u003cp\u003eWraps the original function and returns a new function that manages the throttling behavior.\u003c/p\u003e\n"],["\u003cp\u003eCustomizable with a delay parameter (in milliseconds) and an optional scope for execution context.\u003c/p\u003e\n"]]],[],null,["# ui.util.throttle\n\n\u003cbr /\u003e\n\nWraps a function to allow it to be called, at most, twice per interval. If the wrapper function is called multiple times before the delay elapses, only the first and the last calls will go through.\n\n\u003cbr /\u003e\n\nExample use: For the callback to a slide event on a ui.Slider. The callback will run immediately, making the slide action feel responsive. The callback is also guaranteed to run after the user has finished interacting with the slider, ensuring that the final callback invocation has access to the slider's final value.\n\nReturns the wrapped function.\n\n| Usage | Returns |\n|--------------------------------------------|----------|\n| `ui.util.throttle(func, delay, `*scope*`)` | Function |\n\n| Argument | Type | Details |\n|----------|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `func` | Function | The function to call. |\n| `delay` | Number | The delay, in milliseconds, for the throttle. The function can only be called once after the initial invocation until after the delay has elapsed. |\n| `scope` | Object, optional | The object in whose scope to call the function. |"]]