Skip to content

Commit a75eac6

Browse files
committed
Add ccustom operators and the CallbackBinding type
1 parent 5182527 commit a75eac6

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

Diff for: src/Dash.NET/CallbackBinding.fs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace Dash.NET
2+
3+
type CallbackResultBinding = {
4+
Target: Dependency // Dependency
5+
BoxedResult: obj
6+
} with
7+
static member create (target:Dependency) (boxedResult:obj) =
8+
{
9+
Target = target
10+
BoxedResult = boxedResult
11+
}
12+
13+
static member inline bindResult (target:Dependency) (callbackResult) =
14+
{
15+
Target = target
16+
BoxedResult = box callbackResult
17+
}

Diff for: src/Dash.NET/CallbackBuilder.fs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module CallbackBuilder
2+

Diff for: src/Dash.NET/Dash.NET.fsproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</PropertyGroup>
2424

2525
<ItemGroup>
26-
<None Include="..\..\docs\img\logo.png" Pack="true" PackagePath="\"/>
26+
<None Include="..\..\docs\img\logo.png" Pack="true" PackagePath="\" />
2727
<None Include="DashComponents\htmlComponentBackbone.template" />
2828
<None Include="DashComponents\componentBackbone.template" />
2929
<None Include="DashComponents\Readme.md" />
@@ -172,9 +172,12 @@
172172
<Compile Include="DashComponents\CoreComponents\Upload.fs" />
173173
<Compile Include="DynamicInvoke.fs" />
174174
<Compile Include="Callback.fs" />
175+
<Compile Include="CallbackBinding.fs" />
176+
<Compile Include="CallbackBuilder.fs" />
175177
<Compile Include="DashConfig.fs" />
176178
<Compile Include="Views.fs" />
177179
<Compile Include="DashApp.fs" />
180+
<Compile Include="Operators.fs" />
178181
</ItemGroup>
179182

180183
<ItemGroup>

Diff for: src/Dash.NET/Operators.fs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Dash.NET
2+
3+
module Operators =
4+
5+
let inline (.@) (componentId:string) (componentProperty:ComponentProperty) =
6+
Dependency.create(componentId, componentProperty)
7+
8+
let inline (=>) (target:Dependency) (callbackResult) =
9+
CallbackResultBinding.bindResult target callbackResult

0 commit comments

Comments
 (0)