 					else undefined
 				rootMargin: @inViewportRootMargin
 				threshold: @inViewportThresholdWithMax
-			
+
 			# Start listening
 			@inViewportObserver.observe @$el
-		
+
 		# Remove listeners
 		removeInViewportHandlers: ->
 
 			# Don't remove twice
 			return unless @inViewport.listening
 			@inViewport.listening = false
-			
+
 			# Destroy instance, which also removes listeners
 			@inViewportObserver?.disconnect()
 			delete @inViewportObserver


		# The IntersectionObserver threshold defines the intersection ratios that
		# fire the observer callback
		inViewportThreshold: 
			type: Number|Array
			default: -> [0, 1] # Fire on enter/leave and fully enter/leave
		
	# Bindings that are used by the host component
	data: -> inViewport:


	destroyed: -> @removeInViewportHandlers()

	computed:

		# Add the maxThreshold to the @inViewportThreshold prop so that the handler
		# is fired for elements that are talled than the viewport
		inViewportThresholdWithMax: ->

			# Support number and array thresholds
			threshold =
				if typeof @inViewportThreshold == 'object'
				then @inViewportThreshold
				else [ @inViewportThreshold ]

			# Add only if not already in the threshold list
			if @inViewport.maxThreshold in threshold
			then threshold
