Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: init @sheepdog/vanilla #253

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

feat: init @sheepdog/vanilla #253

wants to merge 15 commits into from

Conversation

paoloricciuti
Copy link
Collaborator

This initialize @sheepdog/vanilla

So, i think i've almost finished the vanilla version (i still need to write all the tests tho)...I'm a bit puzzled by a couple of things:

  1. those are the events that i've defined
type Events =
	| 'error'
	| 'finish'
	| 'cancel'
	| 'instance-create'
	| 'instance-start'
	| 'instance-complete';

type InstanceEvents = 'error' | 'finish' | 'cancel' | 'start' | 'success';

for instance i think it makes perfect sense...you get an event for each state (minus isRunning but you can infer that with a couple of events)
I'm, not super convinced about the ones for the task...technically also error ,finish and cancel should have the prefix instance- because at the end of the day it's one of the instances that is erroring, or starting or etc etc. so maybe it might make sense to just drop instance- everywhere?
3. do you think we should pass something to the events? Like if you do

const my_task = task(...);

my_task.on("error", (/*do you need something here?*/)=>{

});

const performed = my_task.perform();

performed.on("error", (/*what about here?*/)=>{

});
  1. the task function is returning an object which resembles the store we are returning from svelte...but it's just an object. The idea is that since it's the same reference if you use it in an even listener it will be updated when you read the value. What do you think about it?

I think we need to bikeshed it a bit and try to build something with it to get the feel but i'd say i'm pretty happy with the result

@paoloricciuti paoloricciuti added the enhancement New feature or request label Dec 13, 2024
Copy link

netlify bot commented Dec 13, 2024

Deploy Preview for sheepdog ready!

Name Link
🔨 Latest commit d7ec557
🔍 Latest deploy log https://app.netlify.com/sites/sheepdog/deploys/6793a0aa8a96ec000823793e
😎 Deploy Preview https://deploy-preview-253--sheepdog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@paoloricciuti paoloricciuti marked this pull request as draft December 13, 2024 18:07
Copy link

pkg-pr-new bot commented Dec 13, 2024

npm i https://pkg.pr.new/@sheepdog/svelte@253

commit: d7ec557

@paoloricciuti paoloricciuti marked this pull request as ready for review January 10, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant