function fromStore(store) {
	let value = /** @type {V} */ (undefined);

	const subscribe = createSubscriber((update) => {
		let ran = false;

		const unsubscribe = store.subscribe((v) => {
			value = v;
			if (ran) update();
		});

		ran = true;

		return unsubscribe;
	});

	function current() {
		if (effect_tracking()) {
			subscribe();
			return value;
		}

		return get(store);
	}

	if ('set' in store) {
		return {
			get current() {
				return current();
			},
			set current(v) {
				store.set(v);
			}
		};
	}

	return {
		get current() {
			return current();
		}
	};
}
Convert a store to an object with a reactive `current` property. If `store`
is a readable store, `current` will be a readonly property.

```ts
import { fromStore, get, writable } from 'svelte/store';

const store = writable(0);

const count = fromStore(store);

count.current; // 0;
store.set(1);
count.current; // 1

count.current += 1;
get(store); // 2
```
@template V
@param {Writable<V> | Readable<V>} store