Skip to content

Commit

Permalink
Add effect instances 2
Browse files Browse the repository at this point in the history
  • Loading branch information
geirolz committed Jan 23, 2024
1 parent 58a667d commit e18f721
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.geirolz.secret.effect

import cats.effect.Async
import cats.effect.{IO, Resource, ResourceIO}
import cats.effect.{Async, Resource}
import com.geirolz.secret.Secret

extension [T](secret: Secret[T])

def resource[F[_]: Async]: Resource[F, Secret[T]] =
Resource.make(Async[F].pure(secret))(s => Async[F].delay(s.destroy()))

def resourceIO: ResourceIO[Secret[T]] = resource[IO]

0 comments on commit e18f721

Please sign in to comment.