Beispiel #1
0
        private static MutableAtom <int>[] GenerateTreeRoots(int levels)
        {
            var roots = new MutableAtom <int> [levels];

            for (var index = 0; index < roots.Length; index++)
            {
                roots[index] = Atom.Value(0);
            }

            return(roots);
        }
        private void Initialize()
        {
            if (_nextState != null)
            {
                return;
            }

            _nextState = Atom.Value <TState>(null, debugName: $"View<{typeof(TState)}>({name})::State");
            _doRebind  = Atom.Computed(DoRebind, debugName: $"View<{typeof(TState)}>({name})::Bind()", keepAlive: true);
            _doRender  = Atom.Computed(DoRender, debugName: $"View<{typeof(TState)}>({name})::Render()", keepAlive: true);
        }
Beispiel #3
0
 private Widget BuildButton(MutableAtom <int> root)
 {
     return(new NumTreeButton(
                onTap: () => ++ root.Value
                ));
 }
Beispiel #4
0
 public static void Set <T>(this MutableAtom <T> atom, T value)
 {
     atom.Value = value;
 }