Implicit state is the Enemy
大多数人认为CLI工具应该利用隐式状态(如当前工作目录)来简化用户操作。但作者认为,所有隐式假设都是AI代理的绊脚石,明确指定所有参数和路径不仅有利于代理,也让人类用户的脚本更加健壮和可预测。
Implicit state is the Enemy
大多数人认为CLI工具应该利用隐式状态(如当前工作目录)来简化用户操作。但作者认为,所有隐式假设都是AI代理的绊脚石,明确指定所有参数和路径不仅有利于代理,也让人类用户的脚本更加健壮和可预测。
These days, doesn't appear any better than built-in useState hook
But what if you want to update this user instance? For example on your website you have a form where the user can change their name, username, or avatar. When the form is submitted this gets stored on the server, but the site still shows the old user information, for example it still shows the old avatar of the user in the top menu. The user variable isn’t writable, so how do you overwrite this?
One pattern that I love to use in my SvelteKit projects is returning writable stores from the layout’s load function. This makes it possible to fetch data from the server (for example the user object for the logged in user), and then you make this object available as a writable reactive store throughout the whole application. So when the user updates their username or avatar, you do the PUT request to the server and you get the updated user object back from the server as the response, you can simply update the $user writable store value and every place in your app where you show the user object gets updated immediately.
isn't perhaps as robust or scalable as using a full state management solution
Would @stencil/store now be a better option?
Tension management approaches and capabilities – definitions and key references.
Tension management scope: spatial separation, temporal separation, integration, analytical capability, executional capability, emotional capability, relational capability, balancing capability
BlackRock employs a stable of former policymakers, underscoring the importance the company occupies in both financial and policymaking ecosystems, in something akin to a shadow government entity.[157] Good government groups have documented 118 examples of “revolving door” activity by the company—cases in which a government official joined BlackRock’s roster, or vice versa.[158] In one particularly troubling example of how Washington’s revolving door operates, in 2017, a former BlackRock executive was put in charge of reviewing the FSOC’s work for the Treasury Department.[159] Unsurprisingly, the Department’s conclusion was that FSOC should “prioritize its efforts to address risks to financial stability through a process that emphasizes an activities-based or industry-wide approach,” the company’s preferred position.[160] This conclusion all but ensures that BlackRock will not be designated for greater regulation by the FSOC under the Trump administration.
To Big To Fail? Above The Law? Shadow Government?
The term "shadow government" comes up often when investigating Revolving Door partnerships between corporations and former government policymakers. One particular public corporation, BlackRock Investments is the poster child of revolving door activity and comparisons to a shadow government.
BlackRock is front and center in the manipulation of todays Real Estate bubble.
BlackRock should be marketed as;*The Largest Asset Manager and Keeper of The Neo-liberal Flame; We Kill Children to Make You Money and We Enjoy Doing It!*
urql stays true to server data and doesn’t provide functions to manage local state like Apollo Client does. In my opinion, this is perfectly fine as full-on libraries to manage local state in React are becoming less needed. Mixing server-side state and local state seems ideal at first (one place for all states) but can lead to problems when you need to figure out which data is fresh versus which is stale and when to update it.
It is much easier to track what is going on within the activity. Instead of transporting additional state via ctx, you expose the outcome via an additional end event.
Note: It's only super easy to see what's going on if you have the benefit of a diagram.
Encapsulation is used to hide the values or state of a structured data object inside a class, preventing direct access to them by clients in a way that could expose hidden implementation details or violate state invariance maintained by the methods.
DSLs can be problematic for the user since the user has to manage state (e.g. am I supposed to call valid? first or update_attributes?). This is exactly why the #validate is the only method to change state in Reform.
The reason Reform does updating attributes and validation in the same step is because I wanna reduce public methods. This is to save users from having to remember state.
I see what he means, but what would you call this (tag)? "have to remember state"? maybe "have to remember" is close enough
Or maybe order is important / do things in the right order is all we need to describe the problem/need.
PopupState HelperTo make managing the popover state easier, we can use the material-ui-popup-state library to manage the state.
React will update state throughout the user’s session. localStorage won’t change.When the user ends their session, save whatever the state is at that time to localStorage, making it available for hydrating in the next session.
Is this safe/reliable to defer saving until then? What if browser crashes? I guess that's why onbeforeunload is needed. Hopefully onbeforeunload is reliable and can't be skipped (unless browser crashes?).
So rather than continuously keeping localStorage in-sync with React state, let’s simply save state to localStorage whenever the user ends their session, either by leaving the app (‘unmounting’ the component) or refreshing the page.
set(key, v) { localStorage.setItem(key, JSON.stringify(v)) store.set(key, v) return v },
Our large project is going to need highly structured and predictable state management, and Svelte’s flexibility scales from trivial projects up to our big one. We’re looking at statecharts and XState to wrangle this problem.
Imperative UI causes all sorts of problems, most of which revolve around state, which is another fancy term meaning “values we store in our code”. We need to track what state our code is in, and make sure our user interface correctly reflects that state.
Instead of using classes and local state, Deku just uses functions and pushes the responsibility of all state management and side-effects onto tools like Redux.
It adds a few constructs to the language to solve one of the most complex problems in UI development — state management.
State changes flow from the roots of this graph (which we call atoms) through pure functions (which we call selectors) and into components.
Recoil defines a directed graph orthogonal to but also intrinsic and attached to your React tree.
For reasons of compatibility and simplicity, it's best to use React's built-in state management capabilities rather than external global state.
Recoil
Solid’s State primitive is arguably its most powerful and distinctive one. Through the use of proxies and explicit setters it gives the control of an immutable interface and the performance of a mutable one
Since Solid uses fine grained updates and Components are only rendered in their entirety once, you can wrap over state simply by using closures.
MobX - for me personally MobX is a far better way to manage state than React Hooks. It doesn't care about the UI layer so it can be used outside the React ecosystem, and it's simple to mutate data.
The $ contract for auto-subscribing is lovely in its simplicity and flexibility. You can adapt your own preferred state-management pattern or library, with or without Svelte stores as helpers. Svelte does not fuss about how you want to manage your state.
React Stately is a library of state management hooks for use in your component library.
Provides state management for tree-like components. Handles building a collection of items from props, item expanded state, and manages multiple selection state.
So why don't we extract the shared state out of the components, and manage it in a global singleton? With this, our component tree becomes a big "view", and any component can access the state or trigger actions, no matter where they are in the tree!
It turns out that even the length of time an element has been mounted is an important piece of state that determines what pixels the user sees. And some of this state can’t simply be lifted into our application state.
What this means is that our desire to express UI using pure functions is in direct conflict with the very nature of the DOM. It’s a great way to describe a state => pixels transformation — perfect for game rendering or generative art — but when we’re building apps on the web, the idea chafes against the reality of a stateful medium.
Stores are global state. While context is local state.
Notice it's not related to components. Another crucial difference is that it's accessible from outside of components. And good way to determine where goes where is to ask yourself, can this particular state and functionality still makes sense outside of the displayed component?
Made analogy with internal combustion engine, which has 1000s of parts, with the "radical simplicity" approach taken by Tesla: they use an electric motor, which only has 2 components!
comparison: Sapper vs. Gatsby
State management is also easier. Instead of importing hooks and using setters, you just define a property within the script tags. You then change the value by re-assigning it (not mutating the original value).
However, if more control is needed, you can pass any of these pieces of state as a prop (as indicated above) and that state becomes controlled. As soon as this.props[statePropKey] !== undefined, internally, downshift will determine its state based on your prop's value rather than its own internal state.
In this post, I'll walk you through everything you need to know about logs, including what is log and how to use logs for data integration, real time processing, and system building.
One way to guarantee write consistency is by utilizing the event store’s optimistic concurrency control. A proper event store provides a way for the user to say “save this event only if the version of the entity is still x”.
One alternative would be to have one topic per entity
Other alternative: have a consumer group write a read model to a database, indexed by entity id.
Anything that can be derived from the application state, should be derived. Automatically.
Final Form manages its own state. You put state in, with initialValues, and you get state out, with onSubmit
hasNPMPackage: https://www.npmjs.com/package/constate
Vue (pronounced /vjuː/, like view) is a progressive framework for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects.
So how model layer can be integreted?