Cysharp / Cysharp/ObservableCollections
Data parameter in CreateView
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1k
- Forks
- 73
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 2
Description
Is there any reason to not have an overload with the data parameter for CreateView?
With the current signature:
ISynchronizedView<T, TView> CreateView<TView>(Func<T, TView> transform);
viewFactory is captured:
_synchronizedView = myModel.Items
.CreateView(item => {
return viewFactory.Create(item);
});
While this way
ISynchronizedView<T, TView> CreateView<TData, TView>(TData data, Func<T, TData, TView> transform);
it isn't, and the lambda can be made static:
_synchronizedView = myModel.Items
.CreateView(viewFactory, static (item, viewFactory) => {
return viewFactory.Create(item);
});
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the existing CreateView(Func<T, TView>) entry point and compare its captured viewFactory usage with the proposed data-parameter form. Done means callers can pass viewFactory as data and use the static transform shown in the issue, without changing the existing form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100