Skip to content

Commit

Permalink
fix(js): run reactive values only once
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Mar 5, 2021
1 parent 6f22e12 commit 8356031
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/autocomplete-js/src/createReactiveWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ export function createReactiveWrapper() {

return {
reactive<TValue>(value: ReactiveValue<TValue>) {
const current = value();
const reactive: Reactive<TValue> = {
_fn: value,
_ref: { current: value() },
_ref: { current },
get value() {
return this._ref.current;
},
Expand All @@ -31,8 +32,6 @@ export function createReactiveWrapper() {

reactives.push(reactive);

value();

return reactive;
},
runReactives() {
Expand Down

0 comments on commit 8356031

Please sign in to comment.