npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

com.avmedvedskiy.reactiveproperty

v0.1.27

Published

Reactive Property and MVVM binding view

Readme

Releases

ReactiveProperty

Introduction

Custom realization of Reactive Property to implement MVVM patterns Using zero reflection in runtime, use prebaked generation code for get properties

Examples

ViewModel

Monobehaviour ViewModel with Reactive Propertoes.

  • ReactiveProperty will be updated when value are changed
  • ReactiveEvent updated every time, even values are equals

public ReactiveEvent dummyEvent;
public ReactiveEvent<bool> boolEvent;

public ReactiveProperty<bool> boolProperty;
public ReactiveProperty<int> intProperty { get; } = new();

public readonly ReactiveProperty<string> stringProperty;

public ReactiveProperty<CurrencyEnumNew> enumProperty;

View

Default View, will be subscribed when OnEnable

public class TestView : View<int>
{
    protected override void UpdateView(int value)
    {
        Debug.Log(value);
    }
}

Custom Views

Custom Views with many sync properties, need manual subscribe to properties

public class TestEditorView : MonoBehaviour
{
    [Serializable]
    public class SubSerializeClass
    {
        public SyncReactiveProperty<string> stringSyncProp;
        public int someFields;
    }

    [SerializeField] private SyncReactiveProperty<string> syncStringProperty;

    [SerializeField] private SyncReactiveProperty<CurrencyEnumNew> syncCurrencyProperty;
    [SerializeField] private SyncReactiveProperty<float> syncFloatProperty;

    [SerializeField] private SubSerializeClass testSerializationClass;
}

Inspector Drawer

In inspector use dropdown list for select property

image

image

image

Video Example

https://user-images.githubusercontent.com/17832838/185593616-2fe9a97f-a6e2-4ffb-84ab-c753d45cb417.mp4

Reactive Collection

For list in view models use ReactiveList this will enable create views for all items in list

public ReactiveList<T> _models { get; } = new();

For view create a nested class ListView, own Model class and own View(nested ModelView). ListView and View is a monobehaviour;

//example
public class DaysView : ListView<DayView, DayModel>
{
}

[Serializable]
public class DayModel
{
    public int index;
    public bool received;
    public object rewards;
}

public class DayView : ModelView<DayModel>
{
    public ReactiveProperty<int> index;
    public ReactiveProperty<bool> received;
    [NonSerialized] public ReactiveProperty<object> rewards = new();

    public override void SetModel(DayModel model)
    {
        index.Value = model.index;
        received.Value = model.received;
        rewards.Value = model.rewards;
    }
}    

You can override all events from reactive list

public abstract void OnAdd(T item);
public abstract void OnClear();
public abstract void OnInsert(int index, T item);
public abstract void OnRemoveAt(int index);
public abstract void OnReplace(int index, T item);
public abstract void OnValueChanged(int index, T item);
public abstract void OnInitialize(IReadOnlyList<T> values);

List Example

Screens from Unity to show how its look in editor

image

image

image

image

Views Inspector

Custom window to manage all views on GameObject(include childs). Add new View Component, remove exists, change values

image

Generated Code

For all classes contained ReactiveProperty will be generated Dictionary map with string key and property value

public class Resolver_SettingsWindow : IResolver
{
    public IReactiveProperty Map(UnityEngine.Object target, string name)
    {
        var t = (SettingsWindow)target;
        return name switch
        {
            "UserID" => t.UserID,
            "Version" => t.Version,
            _ => throw new ArgumentOutOfRangeException(nameof(name), name, $"Not Found Reactive {name}")
        };
    }
}

public static class BindersLoader
{
    [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
    private static void InitResolvers()
    {
        Binders.AddResolvers(new()
        {
            { typeof(SettingsWindow), new Resolver_SettingsWindow() },
        });
    }
}