move filter and map above

This commit is contained in:
Prabir Shrestha
2020-10-18 23:38:04 +00:00
parent f4cf735905
commit db79feef88

View File

@@ -124,14 +124,14 @@ function M.enable()
C.switchMap(function ()
return C.pipe(
C.fromEvent({ 'TextChanged', 'TextChangedI', 'TextChangedP' }, 'asyncomplete__textchanged'),
C.filter(function () return M.is_enabled_for_buffer() end),
C.map(function () print('textchanged') end),
C.takeUntil(
C.pipe(
C.fromEvent('InsertLeave', 'asyncomplete__insertleave'),
C.map(function() print('insert leave') end)
)
),
C.filter(function () return M.is_enabled_for_buffer() end),
C.map(function () print('textchanged') end)
)
)
end),
C.subscribe({ error = function () M.disable() end })