generated from snivilised/astrolib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(opts): remove apply from pref (#183)
- Loading branch information
1 parent
94137e9
commit 83f023c
Showing
4 changed files
with
40 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package opts | ||
|
||
import ( | ||
"io/fs" | ||
|
||
"github.com/snivilised/traverse/pref" | ||
) | ||
|
||
func Load(_ fs.FS, from string, settings ...pref.Option) (*LoadInfo, *Binder, error) { | ||
o := pref.DefaultOptions() | ||
// do load | ||
_ = from | ||
binder := NewBinder() | ||
o.Events.Bind(&binder.Controls) | ||
|
||
// TODO: save any active state on the binder, eg the wake point | ||
|
||
err := apply(o, settings...) | ||
|
||
return &LoadInfo{ | ||
O: o, | ||
WakeAt: "tbd", | ||
}, binder, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package opts | ||
|
||
import ( | ||
"github.com/snivilised/traverse/pref" | ||
) | ||
|
||
// 📦 pkg: opts - internal options handling | ||
|
||
type ActiveState struct { | ||
} | ||
|
||
type LoadInfo struct { | ||
O *pref.Options | ||
State *ActiveState | ||
WakeAt string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters