Comments (4)
It seems like a bug to me, more simple mcve below:
let test() =
let value = Mutable.create ""
use dynamicVm = Binding.createSource ()
let validator = (notNullOrWhitespace >> hasLengthAtLeast 3)
Binding.mutateToFromViewValidated dynamicVm "Value" validator value
dynamicVm.IsValid |> printfn "empty string: %A" //true, should be false
value.Value <- "Valid"
dynamicVm.IsValid |> printfn "Valid string : %A" //true, should be true
value.Value <- "-"
dynamicVm.IsValid |> printfn "Invalid string : %A" //true, should be false
from gjallarhorn.
Okay, I guess I found why it happened. There a two reasons:
- The part of code that responds for updating the mutable.
https://github.com/ReedCopsey/Gjallarhorn/blob/master/src/Gjallarhorn/IO.fs#L95-L99
it seems like updating only when changing validation result instead of just a value, so I think it should be something like that:
let subscription =
validated
|> Signal.Subscription.create(Option.iter(Mutable.set input))
- About "decorator".
https://github.com/ReedCopsey/Gjallarhorn/blob/master/src/Gjallarhorn/IO.fs#L88-L89
MutatableInOut
inherit InOut
instead of ValidatedInOut
, so there:
can't be convert to ValidatedInOut
from gjallarhorn.
Thank you @FoggyFinder - You were right about the underlying problem - changing the inheritance solved this. Added 2 new tests for this as well.
from gjallarhorn.
Thank you for reacting to this so quickly and fixing the issue!
from gjallarhorn.
Related Issues (20)
- Problem with loading resources in Wpf.Framework HOT 1
- Request for Feedback: Update HOT 5
- Elm module HOT 12
- Possible crash issue in BoundCollection
- Add a .Net "standard" version. HOT 16
- Add documentation for Binding API HOT 1
- Add a sample walkthrough which documents how to bind signals in a simple app using this lib HOT 2
- Question: 'Back propogation' from values HOT 5
- Subscriptions fire when mutable is set to same value HOT 5
- What is blocking creating signals from the standard mutables HOT 4
- Unexpected subscription notifications
- Multi targeting
- Errors in CoreTypes.fs HOT 1
- Migration to the FAKE 5
- Validators.containedWithin<RecordType> -> System.FormatException HOT 1
- .Add notifies even when underlying value has not changed HOT 2
- How to build the project? HOT 1
- Errors resulting from 'as self' HOT 5
- `lift` has an unused input
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gjallarhorn.