@@ -82,7 +82,7 @@ function M.set(key, value, opts)
8282
8383 _state [key ] = value
8484 if not vim .deep_equal (old , value ) then
85- M .notify (key , value , old )
85+ M .emit (key , value , old )
8686 end
8787
8888 return value
@@ -148,7 +148,7 @@ function M.unsubscribe(key, cb)
148148 end
149149end
150150
151- function M .notify (key , new_val , old_val )
151+ function M .emit (key , new_val , old_val )
152152 vim .schedule (function ()
153153 if _listeners [key ] then
154154 for _ , cb in ipairs (_listeners [key ]) do
@@ -182,7 +182,7 @@ function M.append(key, value)
182182
183183 local old = vim .deepcopy (_state [key ] --[[ @as table]] )
184184 table.insert (_state [key ] --[[ @as table]] , value )
185- M .notify (key , _state [key ], old )
185+ M .emit (key , _state [key ], old )
186186end
187187
188188--- @param key string
@@ -197,7 +197,7 @@ function M.remove(key, idx)
197197
198198 local old = vim .deepcopy (_state [key ] --[[ @as table]] )
199199 table.remove (_state [key ] --[[ @as table]] , idx )
200- M .notify (key , _state [key ], old )
200+ M .emit (key , _state [key ], old )
201201end
202202
203203return M
0 commit comments