Skip to content

Commit

Permalink
Sponsor.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcglasberg committed Oct 30, 2024
1 parent f7b9996 commit 1d7cebd
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 112 deletions.
34 changes: 20 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
## [3.0.1] - 2021/05/12
## 4.0.0

* Sponsored by [MyText.ai](https://mytext.ai)

[![](./example/SponsoredByMyTextAi.png)](https://mytext.ai)

## 3.0.1

* Flutter 3.10.0 and Dart 3.0.0

## [2.1.0] - 2021/09/13
## 2.1.0

* `cache2states_3params((state1, state2) => (param1, param2, param3) => ...);`

## [2.0.4] - 2021/12/25
## 2.0.4

* Docs improvement.

## [2.0.2]
## 2.0.2

* NNBD improvement.

## [2.0.0]
## 2.0.0

* Cache functions with extra parameters.
* Rename of cache functions to make them easier to use.
Expand All @@ -34,39 +40,39 @@ cache2states_0params_x((state1, state2, extra) => () => ...);
cache3states_0params_x((state1, state2, state3, extra) => () => ...);
```

## [1.4.0-nullsafety.0]
## 1.4.0-nullsafety.0

* Migrating to null safety

## [1.3.2] - 2020/08/13
## 1.3.2

* Type parameters rename (clean-code).

## [1.3.1] - 2020/08/11
## 1.3.1

* cache3_0.

## [1.2.2] - 2020/07/28
## 1.2.2

* Dependency bump.

## [1.2.1] - 2020/06/12
## 1.2.1

* Cache functions.

## [1.1.2] - 2020/05/26
## 1.1.2

* Add is by identity.
* Docs improvement.

## [1.0.6] - 2020/05/19
## 1.0.6

* Removed dependency on Flutter (it's now pure Dart).

## [1.0.2] - 2020/05/18
## 1.0.2

* Example.

## [1.0.0] - 2020/05/18
## 1.0.0

* WeakMap and WeakContainer.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![](./example/SponsoredByMyTextAi.png)](https://mytext.ai)

[![pub package](https://img.shields.io/pub/v/weak_map.svg)](https://pub.dartlang.org/packages/weak_map)

# weak_map
Expand Down
Binary file added example/SponsoredByMyTextAi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 1 addition & 28 deletions lib/src/cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import 'dart:collection';

import 'package:weak_map/weak_map.dart';

// /////////////////////////////////////////////////////////////////////////////

typedef R1_0<Result> = Result Function();
typedef F1_0<Result, State1> = R1_0<Result> Function(State1);

Expand All @@ -29,8 +27,6 @@ F1_0<Result, State1> cache1state<Result, State1>(F1_0<Result, State1> f) {
};
}

// /////////////////////////////////////////////////////////////////////////////

typedef R1_1<Result, Param1> = Result Function(Param1);
typedef F1_1<Result, State1, Param1> = R1_1<Result, Param1> Function(State1);

Expand Down Expand Up @@ -68,8 +64,6 @@ F1_1<Result, State1, Param1> cache1state_1param<Result, State1, Param1>(
};
}

// /////////////////////////////////////////////////////////////////////////////

typedef R1_2<Result, Param1, Param2> = //
Result Function(Param1, Param2);

Expand Down Expand Up @@ -108,8 +102,6 @@ F1_2<Result, State1, Param1, Param2> cache1state_2params<Result, State1, Param1,
};
}

// /////////////////////////////////////////////////////////////////////////////

typedef R2_0<Result> = Result Function();
typedef F2_0<Result, State1, State2> = R2_0<Result> Function(State1, State2);

Expand Down Expand Up @@ -145,9 +137,8 @@ F2_0<Result, State1, State2> cache2states<Result, State1, State2>(
};
}

// /////////////////////////////////////////////////////////////////////////////

typedef R2_1<Result, Param1> = Result Function(Param1);

typedef F2_1<Result, State1, State2, Param1> = R2_1<Result, Param1> Function(
State1,
State2,
Expand Down Expand Up @@ -193,8 +184,6 @@ F2_1<Result, State1, State2, Param1> cache2states_1param<Result, State1, State2,
};
}

// /////////////////////////////////////////////////////////////////////////////

typedef R2_2<Result, Param1, Param2> = //
Result Function(Param1, Param2);

Expand Down Expand Up @@ -240,8 +229,6 @@ F2_2<Result, State1, State2, Param1, Param2> //
};
}

// /////////////////////////////////////////////////////////////////////////////

typedef R2_3<Result, Param1, Param2, Param3> = //
Result Function(Param1, Param2, Param3);

Expand Down Expand Up @@ -287,8 +274,6 @@ F2_3<Result, State1, State2, Param1, Param2, Param3> //
};
}

// /////////////////////////////////////////////////////////////////////////////

typedef R3_0<Result> = //
Result Function();

Expand Down Expand Up @@ -332,8 +317,6 @@ F3_0<Result, State1, State2, State3> cache3states<Result, State1, State2, State3
};
}

// /////////////////////////////////////////////////////////////////////////////

typedef F1_0_x<Result, State1, Extra> = R1_0<Result> Function(State1, Extra);

/// Cache for 1 immutable state, no parameters, and some extra information.
Expand Down Expand Up @@ -362,8 +345,6 @@ F1_0_x<Result, State1, Extra> cache1state_0params_x<Result, State1, Extra>(
};
}

// /////////////////////////////////////////////////////////////////////////////

typedef F2_0_x<Result, State1, State2, Extra> = R2_0<Result> Function(State1, State2, Extra);

/// Cache for 2 immutable states, no parameters, and some extra information.
Expand Down Expand Up @@ -400,8 +381,6 @@ F2_0_x<Result, State1, State2, Extra> cache2states_0params_x<Result, State1, Sta
};
}

// /////////////////////////////////////////////////////////////////////////////

typedef F3_0_x<Result, State1, State2, State3, Extra> = R3_0<Result> Function(
State1, State2, State3, Extra);

Expand Down Expand Up @@ -446,8 +425,6 @@ F3_0_x<Result, State1, State2, State3, Extra>
};
}

// /////////////////////////////////////////////////////////////////////////////

class _Pair<X, Y> {
final X x;
final Y y;
Expand All @@ -467,8 +444,6 @@ class _Pair<X, Y> {
int get hashCode => Object.hash(x, y);
}

// /////////////////////////////////////////////////////////////////////////////

class _Triad<X, Y, Z> {
final X x;
final Y y;
Expand All @@ -489,5 +464,3 @@ class _Triad<X, Y, Z> {
@override
int get hashCode => Object.hash(x, y, z);
}

// /////////////////////////////////////////////////////////////////////////////
5 changes: 1 addition & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: weak_map
description: WeakMap is a map where the keys are weakly referenced. WeakContainer lets you check if an object is the same you had before. Cache functions for memoization with weak-references.
version: 3.0.1
version: 4.0.0
# author: Marcelo Glasberg <marcglasberg@gmail.com>
homepage: https://github.com/marcglasberg/weak_map
topics:
Expand All @@ -15,6 +15,3 @@ environment:

dev_dependencies:
test: ^1.17.12



Loading

0 comments on commit 1d7cebd

Please sign in to comment.