structures 1.4.0
structures: ^1.4.0 copied to clipboard
Commonly used standalone data structures, types and extensions that simplify application logic development.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.4.0 #
Released on 14/09/2023 #
Changed
FieldValue
is now aEntry
instead. to minimize confusion withValue
.FieldDate
is now aDateEntry
instead.FieldText
is now aTextEntry
instead.
1.3.0 #
Released on 25/08/2023 #
Updated
- Improved the
LiveValue
implementation by switching fromValidation
to theEither
data type - Enhanced error handling capabilities.
- Enhanced the
titleCase
function to handle both snake case and camel case inputs, improving naming consistency.
Changed
- Streamlined the
Failure
structure for simplicity. It now contains only the fieldsreason
andsuggestion
. - This change increases readability and maintainability of failure handling.
- Added properties of
FailureOrigin
directly toFailure
for a more direct error tracing approach.
Removed
- Eliminated unnecessary
FailureMessage
andFailureOrigin
types, - Consolidated failure-related information into the simplified
Failure
type.
1.2.0 #
27/06/2023 #
Updated
- New structure for
structure
package. - Updated
structure
package to useEither
instead ofValidation
. - Updated readme.
1.1.0 #
21/02/2023 #
Fixed
- Changelog versioning
Changed
Field
now has aname
property, andlabel
can show * when the fieldisRequired
.Success
has been removed fromValidation
, as it is no longer required with use of Either.ValidableField
andValidatable
are also removed as they are no longer required.AdapterFactory
is nowModelFactory
.
Added
Model
class to define a model.
1.0.0 #
13/02/2023 #
Fixed
LiveValue.update
now uses deep equality to check if the value has changed. This fixes a bug where the value was updated even if the value was the same.
Added
- Better documentation of classes and methods.
FailureMessage
class to hold reason and suggestion for a failure.LiveFailureMessage
extension toValue
that holdsFailureMessage
.FailureOrigin
class to hold the origin of a failure for context, and logging.Field
class to define properties of a field, like label, hint, etc.ValidatableField
interface to define a field that can be validated.
Changed
Validation
now hasSuccess
andFailure
as subclasses.Sucess("data")
is nowSuccess(data: "data")
, data is now a named parameter.Failure
is now complete concrete class, no longer abstract, just likeSuccess
.Either
is now a full either monad.Emptiable
is now has aisDefined
andisUndefine
methods, and anone
constant.Time
is nowRealTime
extension.
Removed
IdentityExtension
is now removed, as it is not needed anymore.
0.0.14 #
04/01/2023 #
Changed
Live.listen
now default to notifying if notified.- Added a
runOnAttach
toLive.listen
to explicitly turn on running when the listener is first added. ChoiceList
now allows any arbitrary list of items, not need to extendAChoice
.
Added
VoidCallack
ValueObserverCallback
ValueConsumerCallback
Value.onValue
method, that enables adding a listener that takes the new changed value.Value.onValue
method, that enables adding a listener that takes the oldValue and the new changed value.Value<List<T>>
extensions that provide list accessors methods/fields without.value
.Value<Map<I,T>>
extensions that provide Map accessors methods/fields without.value
.LiveValue<List<T>>
extensions that give list mutating methods/fields without.value
andupdate
.LiveValue<Map<I,T>>
extensions that give Map mutating methods/fields without.value
andupdate
.
0.0.13 #
07/12/2022 #
Changed
- LiveValue to never be const to avoid literal overwrite bug
Added
- An experimental api for turn any list of items into a ChoiceList
0.0.11 #
28/11/2022 #
Fixed
- ChoiceList double updates bug
Added
- Live ChoiceList index for observing currently selected index
0.0.10 #
28/11/2022 #
Fixed
- ChoiceList double updates bug
Added
- Live ChoiceList index for observing currently selected index
0.0.9 #
28/11/2022 #
Updated
- Make Choice observable by default
- Improved Choice list usage info
Added
- Experimental Memory object
- More tests
0.0.5 #
24/11/2022 #
Added
- Choice abstract class
- ChoiceList fix length List<T> implementation
- Added ChoiceList methods to use on Choice item with a given id
select(id)
unselect(id)
toggle(id)
get(id)
- Added ChoiceList methods to use on Choice item at a given index
selectIndex(index)
unselectIndex(index)
toggleIndex(index)
0.0.2 #
21/11/2022 #
Added
- Selectable class interface
asSelected
asUnSelected
isSelected
toggle
- SelectableList class
select(index)
unSelect(index)
toggle(index)
0.0.0-dev.1 #
31/10/2022 #
Added
- Initial template scaffold.
- GitHub workflow
- String Validator
- Adapter Factory
- Either
- Emptiable interface
- Live listenable interface
- List extension including map2, map3 with index
- LiveValue a reactive listenable with value
- Generic notifier with const constructor
- A simple (maybe simplistic 😄) Pair type
- A Time module class
- Validation module
- Validatable interface
- A Generic Value interface
- Value Types interfaces