Skip to content

Instantly share code, notes, and snippets.

View jouana's full-sized avatar
💭
I may be slow to respond.

Antoine Jouan jouana

💭
I may be slow to respond.
View GitHub Profile
@jouana
jouana / BindingHook.js
Last active April 12, 2021 16:19
React MVVM example
function BindingHook({ dataContext, path, mode }) {
const [data, setData] = useState(dataContext[path]);
useEffect(() => {
onPropertyChanged = (newData) => {
setData(newData);
};
dataContext.subscribeOnPropertyChanged(path, onPropertyChanged);
public interface IHasId
{
string id { get; }
}
public class IRepository<Domain>
where Domain : IHasId {
Domain FindById(string id);
}